当apache为404提供服务时,我有一个重定向:
ErrorDocument 404 https://my404.com/image.jpg
# other rewrite rules that cannot be affected如何仅在应用上述重定向时设置no-cache标头?
发布于 2018-02-19 04:17:26
根据这个答案,How to prevent http file caching in Apache httpd (MAMP)将以下代码放在.htaccess文件中:
<filesMatch "image\.jpg$">
FileETag None
<ifModule mod_headers.c>
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
Header set Expires "Wed, 11 Jan 1984 05:00:00 GMT"
</ifModule>
</filesMatch>https://stackoverflow.com/questions/48853924
复制相似问题