开发者

How do I cache control?

开发者 https://www.devze.com 2023-03-18 06:22 出处:网络
How do I get my website to save images to clients computer and use them, not redownload them every page reload?

How do I get my website to save images to clients computer and use them, not redownload them every page reload?

I tried to send header("Cache-Control: max-开发者_如何学运维age=3600"); but that had no effect.


You'll need to sand caching headers for the image files, not for your HTML document. You can use the header function only if the files are actually served by a PHP script - not if they are static files handled by the web server. If they are static files, check the documentation for your web server of choice.

Also consider sending en Expires header, and disable ETags.

0

精彩评论

暂无评论...
验证码 换一张
取 消