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

问题描述 投票:1回答:1

1. enter image description here

在我的情况下,.js文件是从磁盘缓存中提取的,无论如何它都需要花费大量时间。

2. enter image description here

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

html google-chrome web google-chrome-devtools browser-cache
1个回答
0
投票

在服务器的响应中将Response Header设置为

Cache-Control: public, max-age=31536000
© www.soinside.com 2019 - 2024. All rights reserved.