2

I see many websites, seemingly arbitrarily adding the no cache meta tag on every page.

Like this:

<META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-CACHE">
<META HTTP-EQUIV="EXPIRES" CONTENT="-1">

What is it good for and why are they doing it?

Is it bad or good for performance?

Will it prevent http expires headers to function and ultimately slow down a website?

5 Answers 5

3

Using a no-cache meta tag is a bad idea. Page caching is valuable for both SEO and user experience. Caching will improve (lower) page load times. This means a user sees the content faster, which reduces abandonment rates - especially on mobile devices.

Ideally users will use settings to clear their browser cache, however this cannot be assumed. A preferred workaround is to leverage browser caching settings in your htaccess file. Add the following to your htaccess file:

##EXPIRES CACHING##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType text/js "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/x-javascript "access plus 1 month"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 2 days"
</IfModule>

##Configure Entity Tags##
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|js|css|swf)(\.gz)?$">
Header set Expires "Mon, 1 Jan 2020 01:00:00 GMT"
Header unset ETag
FileETag None
</FilesMatch>
2

Caching speeds up repeat views and not first time visits so in terms of SEO value it means little since the first view time is the most important factor. Caching is good however because it means when people switch from page to page they are only loading the resources they need so this will boost user experience.

Using no-cache will disable the cache and <META HTTP-EQUIV="Expires" CONTENT="-1"> forces an immediate expiration on the file should the CMS or htaccess sets an expire.

Generally its not required and spoils user experience when setting up this way.

2

These headers are used to discourage browsers or proxies from caching the page. For dynamically generated content the headers would be there to try and ensure site visitors are always hitting the server and so are always getting up-to-the minute content.

To answer your specific question, these headers may negatively affect performance because they may prevent caching, and caching is good for performance. But in practice they probably make little difference.

1
  • Very few web pages themselves are explicitly cached. We all cache CSS/JS/images and often forget about the HTML. Jun 10, 2013 at 9:35
2

The use of 'to cache or no-cache depends on the end performance sort:

1) Affiliate Marketers - need to 'cache tags' when pages etc go to landing pages as the cookies are needed for allocation of funds.

2) Informative/ transformational posts - use of 'non-cache tags' no-cookies as social trust factors are being built.

1

I agree with James. Google in particular is giving more weight to page load times these days, and both caching and compression speed up page loads. They also improve user experience, especially on mobile, which is a good enough reason in itself to do it.

https://developers.google.com/speed/

1
  • The first load is what they're interested in though. It doesn't matter for them if you're caching. The difference is it make the for a much better UX if you do it.
    – Fuzzy
    Oct 17, 2021 at 12:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.