Caching on Project Shield
Caching is a feature of Project Shield and part of Project Shield’s DDoS defenses.
Project Shield respects the cache control headers for all resources and HTML that your site serves. If no cache control headers are present, Project Shield will cache content by default.
Enabling caching for your website maximizes Project Shield’s DDoS mitigation and may also improve your website's performance.
Set your cache settings
Caching on Project Shield is in your control based on your cache control headers. You can adjust caching settings by editing your cache control headers. Learn more about cache control HTTP headers.
Here is an example of cache control headers:
Cache for 1 day (suitable for images - jpg, png, gifs) cache-control:max-age=86400
Not cacheable (suitable for HTML) cache-control:no-cache,private
Project Shield will fetch new content from your website server (or re-validate that the content in cache is still valid) when content is requested after your cache control headers expire.
For example, if your site’s homepage has cache control headers set to 1 hour, then Project Shield will serve your content from cache for an hour. After that time, Project Shield will revalidate on the next request for your content, and retrieve the latest version from your server if your content changed and store that version in cache.
If no cache control headers are present, Project Shield will cache content by default.
Your Project Shield dashboard shows your site’s cache hit rate graph under Site Details. Learn more about traffic and performance graphs.
Turn off caching
To turn off caching, set your site’s cache control headers to “cache-control: no-cache, private.”
With this setting, Project Shield will never cache your website and will send all requests and traffic direct to your website server.
If you have a need to turn off caching without using cache-control headers, reach out directly to the Project Shield team through this contact form.