Home > Article > Backend Development > javascript - cache-control sets css to force cache invalidation
I want to force caching of my a.css file.
The method I use is to modify apcache’s httpd.conf. The code is as follows:
<code>LoadModule headers_module modules/mod_headers.so header set cache-control "max-age=1000"</code>
Debugging found that cache-control has been set correctly:
But it still doesn’t work:
Ideally it should return 200, and then the Size is from cache.
Puzzled...
I want to force caching of my a.css file.
The method I use is to modify apcache’s httpd.conf. The code is as follows:
<code>LoadModule headers_module modules/mod_headers.so header set cache-control "max-age=1000"</code>
Debugging found that cache-control has been set correctly:
But it still doesn’t work:
Ideally it should return 200, and then the Size is from cache.
Puzzled...
Press enter in the address bar: If there is a browser cache, read the cache from disk cache
F5/ctrl+r: It will request the browser anyway, and if the resource has not expired, it will return 304
ctrl +F5: Requests will be made to the browser anyway, forcing the resource to be returned 200
Thank you, right click on the chrome refresh button. You can also see the status mentioned above