简体   繁体   中英

Cache-Control HTML Headers

In an effort to tell a browser's cache how to treat my site, I wanted to write some cache control rules in the header. There is a great resource here , but I cant seem to find the correct cache control code for my situation.

Because my website is static, I want the browser to always keep the data in its cache. BUT, the pages that do change (portfolio,blog) I want to be cached with an expiration of 3600 seconds.

Anyone know how to do this correctly?

Since you're using a hosting provider, I assume you can't control the actual HTTP headers? Instead, you can use <meta> tags to tell the browser what to do on a page-by-page basis.

As for headers, I'd rather just read straight from the horses mouth: see section 14.9 in HTTP 1.1 Headers specification .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM