如何将静态文件存储在内存缓存中

时间:2017-05-19 15:36:08

标签: html5 google-chrome web google-chrome-devtools browser-cache

1。enter image description here

在我的情况下.js文件是从磁盘缓存中获取的,无论如何它需要相当长的时间。

2。enter image description here

但在另一个项目中,我注意到.js和其他静态文件都是从内存缓存中获取的。 我怎样才能实现同样的目标?

1 个答案:

答案 0 :(得分:0)

在服务器的响应中将响应标题设置为

Cache-Control: public, max-age=31536000