top of page
  • Writer's pictureBrent Payne

Serve static assets with an efficient cache policy

The URLs in question could potentially include resource URLs like media or script files that do not contain a specified cache header.


Why is this important?

Network requests can be slow and costly. Large sized responses can require multiple roundtrips and consequently delay processing and incur additional data costs for users.


Caching through server response header informs the browser that subsequent downloads of the asset are unnecessary, thus reducing requests to the server. Therefore, HTTP caching enhances page load times during subsequent visits.


What does the Optimization check?

This check is activated when any internal resource lacks caching, or where caching policy duration is shorter than one year (31536000 seconds).


Resources regarded as 'cacheable' receive a 200 status code, are free from a no-cache directive, and are typically fonts, images, media, scripts, or stylesheets.


How do you resolve this issue?

Implementing the Cache-Control header in your server's response is crucial as it enables caching within the browser. Once activated with appropriate values, the browser will store the file for the specified timeframe. Without it, the file would be fetched repeatedly with each visit.


To add the header, configure your server:

Cache-Control: max-age=31536000


The max-age directive indicates the duration for which the browser should cache the resource, stated in seconds. Setting it to 31536000 seconds equals one year.

Strive to cache as many responses as you can for the maximum duration permitted, including validation tokens to allow efficient revalidation.


Analyze the decision-making diagram to identify an optimal caching policy for specific resources in your application.


Further Reading

20 views0 comments

Recent Posts

See All

CSS file size too large discovered in SEO audit

In our SEO audits at Loud Interactive, we often come across a common yet significant issue that can heavily impact your website's loading speed and overall performance: CSS file size too large. Let's

CSS file size too large discovered in SEO audit

When conducting an SEO audit on your site, one issue that might come up is that your CSS file size is too large. But why does this matter, and what can you do about it? Let's dive in. What's the Issue

H1 tag missing or empty" Discovered in an SEO Audit

At Loud Interactive, we've encountered a common issue during our SEO audits that can significantly impact a website's performance on search engines: the "H1 tag missing or empty" warning. This problem

bottom of page