The Cache Control header supports multiple directives that control how caching should behave. Each directive serves a different purpose depending on the type of content being delivered.
The max age directive defines how long a resource should be considered fresh. The value is expressed in seconds. While the resource remains fresh the browser or CDN can serve it directly without contacting the origin server.
Example
Cache Control: max age=3600
This means the content can be cached for one hour.
The public directive allows the response to be stored by any caching system including browsers and shared caches such as CDN edge servers. This directive is commonly used for static files like images scripts and stylesheets.
Example
Cache Control: public, max age=86400
This configuration allows the content to be cached for one day.
The private directive indicates that the response is intended for a single user and should not be stored by shared caches. Only the user's browser may cache the content.
Example
Cache Control: private, max age=3600
This directive is often used for personalized pages such as account dashboards.
The no store directive completely disables caching. Neither the browser nor intermediate caches are allowed to store the response. This is typically used for sensitive data.
Example
Cache Control: no store
The no cache directive allows content to be stored but requires the cache to check with the origin server before serving it again. This ensures the user always receives the most recent version.
Example
Cache Control: no cache
This directive instructs caches to revalidate stale content with the origin server before delivering it to users. It ensures outdated resources are not served after their freshness period expires.
Example
Cache Control: max age=3600, must revalidate
This directive allows a cached resource to be served temporarily even after it becomes stale while a background request retrieves a fresh copy from the origin. This helps maintain fast response times during content updates.
Example
Cache Control: max age=3600, stale while revalidate=86400
The stale if error directive allows a cached response to be served if the origin server fails or returns an error. This helps maintain availability during temporary outages.
Example
Cache Control: max age=3600, stale if error=86400
The immutable directive signals that the resource will not change during its lifetime. Browsers can reuse the cached version without rechecking with the server.
This directive tells intermediate systems not to modify the content. Some proxies may compress or optimize responses but this directive prevents such changes.
Different types of content require different caching strategies. Choosing the right Cache Control directives ensures the best balance between performance and accuracy.
Static assets such as images JavaScript files and stylesheets benefit from long caching periods. These files rarely change and allowing them to remain cached reduces page load times significantly.
Example
Cache Control: public, max age=86400
User specific pages such as account dashboards should not be stored in shared caches. These responses should remain private to avoid exposing personal information.
Example
Cache Control: private, max age=3600
Sensitive data such as login pages or payment forms should not be cached at all.
Example
Cache Control: no store
Websites that publish frequently updated content such as news platforms often combine caching with revalidation to maintain freshness.
Example
Cache Control: no cache
High traffic landing pages may allow slightly outdated content if it improves speed during peak demand. Using stale while revalidate ensures fast responses while the CDN refreshes content in the background.
Example
Cache Control: max age=3600, stale while revalidate=86400
VergeCloud makes it easy to manage caching behavior through its dashboard. Administrators can configure caching rules directly without modifying origin server settings.
First log in to the VergeCloud user panel and open the Content Delivery Network section.
Select the domain for which you want to configure caching behavior.
Navigate to the Page Rules section and either create a new rule or edit an existing one.
Within the rule settings open the caching configuration options.
Choose the cache operation level and specify the desired Cache Control directives such as max age or public caching.
Once the configuration is saved VergeCloud will begin applying the rules across its global edge network. Requests that match the rule will follow the defined caching behavior automatically.
The Cache Control header plays a central role in modern web performance optimization. By defining how resources should be cached it helps reduce unnecessary network requests and improves response times for users.
When combined with VergeCloud's global CDN infrastructure the benefits become even greater. Edge caching allows frequently requested content to be delivered quickly from locations close to users while still maintaining accurate and updated data.
Understanding how to use Cache Control directives allows website owners and developers to create efficient caching strategies tailored to different types of content. Whether you are delivering static assets dynamic pages or sensitive information the correct configuration ensures both speed and reliability.
With VergeCloud tools such as page rules and flexible caching policies administrators can easily control how content is stored and delivered across the entire edge network. Proper caching not only improves performance but also reduces load on origin servers and enhances the overall experience for every visitor.