I'd like to apply this to browsers:
header('Cache-Control: max-age=3600');
But apply this to my CDN:
header("Cache-Control: no-cache");
In other words I want the CDN to treat it as dynamic content but browsers to still store the response in their local cache. Is there any standard way of doing this?
What is the difference between CDNs and caching? CDNs are geographically distributed networks of proxy servers and their objective is to serve content to users more quickly. Caching is the process of storing information for a set period of time on a computer.
Web browsers cache HTML files, JavaScript, and images in order to load websites more quickly, while DNS servers cache DNS records for faster lookups and CDN servers cache content to reduce latency.
To disable the CDN Go to Performance>General settings and disable the CDN. make sure to save all settings and purge the cache. This will disable the CDN and purging the cache will allow the files to be visible again and served from your server. You can then simply re-enable the CDN again when you choose to do so.
Cache-controlTells the browser to not cache the content in any way. It is mostly used when dealing with sensitive data or with data that changes frequently. Marks the content as public, which means it can be cached by the browser and any intermediary parties (such as proxies, etc).
You can do that with
Cache-Control: private, max-age=3600
So that an eventual CDN/intermediate proxy is bypassed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With