javascript - cache-control sets css to force cache invalidation

WBOY
Release: 2023-03-01 21:28:01
Original
1630 people have browsed it

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>
Copy after login
Copy after login

Debugging found that cache-control has been set correctly:

javascript - cache-control sets css to force cache invalidation

But it still doesn’t work:

Ideally it should return 200, and then the Size is from cache.

javascript - cache-control sets css to force cache invalidation

Puzzled...

Reply content:

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>
Copy after login
Copy after login

Debugging found that cache-control has been set correctly:

javascript - cache-control sets css to force cache invalidation

But it still doesn’t work:

Ideally it should return 200, and then the Size is from cache.

javascript - cache-control sets css to force cache invalidation

Puzzled...

The results will be different depending on the refresh action. Please check:

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

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!