Find us at BrightonSEO 25/26 April - STAND 18! Fill your swag bag!

Dealing with Page Speed issues?

Crawl your website with Sitebulb for 300+ tech SEO checks

Try for Free

This Hint has been deprecated, and has been superseded by Serve static assets with an efficient cache policy. In order to get the most accurate audit results from Sitebulb, please ensure you update to the latest version.

High This Hint is very important, and definitely warrants attention. Issue This Hint represents an error or problem that needs to be fixed.

Resources that do not specify long cache headers

This means that the URL in question is a resource URL, such as images or JavaScript files, which specifies a cache header of less than 30 days.

Why is this important?

Fetching something over the network is both slow and expensive. Large responses require many roundtrips between the client and server, which delays when they are available and when the browser can process them, and also incurs data costs for the visitor. Setting a cache header on your server response will tell the browser that it doesn't need to download assets again, which avoids unnecessary requests to the server.

For files that do not tend to change, such as images, you should look to increase the cache time period, which means the files stay in the browser cache for longer, thus avoiding extra requests to the server.

What does the Hint check?

This Hint will trigger for any internal resource URL that specifies a cache header of more than 3600 seconds (1 hour), but less than 2592000 seconds (30 days).

Examples that trigger this Hint:

Resource file URLs that have a cache header where the 'max age' is more than 3600 but less than 2592000:

HTTP/... 200 OK

...
Cache-Control => max-age=604800
Content-Type => image/png

How do you resolve this issue?

It is not possible for Sitebulb to divine which files rarely change, so you will need to manually check which files do not change regularly, and would benefit from longer cache headers.

Ideally, you should aim to cache as many responses as possible on the client for the longest possible period, and provide validation tokens for each response to enable efficient revalidation.

Under normal usage, the starting point for any developer should be to add as an aggressive caching strategy to the files in the application that will not change. Normally this will include static files that are served by the application such as images, CSS file and Javascript files. As these files are typically re-requested on each page, a large performance improvement can be had with little effort.

In these instances, you should set the Cache-Control header, with a max-age value of a year in the future from the time of the request. It is recommended that Expires should be set to a similar value.

Follow the decision tree below to determine the optimal caching policy for a particular resource, or a set of resources, that your application uses.

Defining cache decisions

Further Reading

Sitebulb Desktop

Find, fix and communicate technical issues with easy visuals, in-depth insights, & prioritized recommendations across 300+ SEO issues.

  • Ideal for SEO professionals, consultants & marketing agencies.

Sitebulb Cloud

Get all the capability of Sitebulb Desktop, accessible via your web browser. Crawl at scale without project, crawl credit, or machine limits.

  • Perfect for collaboration, remote teams & extreme scale.