I cannot figure out why my rankings dropped, at the same time I deployed 4 Nginx cache servers on different continents.

When I serve the PHP pages, I set this expiration header from the origin server, so my Nginx could cache these pages for x amount of time without asking for them at the origin server again, and to serve them faster to nearby clients.

Are these bad for SEO maybe? Do they also signal to Googlebot that these pages will expire in this amount of time and Google might stop sending traffic to them until it finds them again?

Do I normally need to trim these headers on the last servers and only use these headers between my Nginx cache and the origin server?

$cache_seconds = 60*5; 

header("Expires: ".gmdate('D, d M Y H:i:s \G\M\T', time()+$cache_seconds));
header("Cache-Control:public, max-age=".$cache_seconds); 

Google does not use cache headers to determine how long a page should be in its search index. Googlebot doesn't need to re-crawl the page every time its cached version expires to keep the page in the search index.

I'm not sure what is causing your ranking problems, but it is very unlikely to be related to your cache headers. Your cache headers look fine to me.

If anything check that Googlebot didn't get adversely affected by your changes. It should mostly be hitting your server close to the US because most Googlebot crawling happens from the US. Make sure Googlebot isn't getting more error pages than it used to.

  • Not even if the fixed date expires header is a few minutes or hours in the past, isn't that bad for Google ? I think that can happen because of different user timezone than server. E.g "here is some content that is already expired" :) – adrianTNT Feb 22 '20 at 14:48
  • 1
    For SEO? No, it shouldn't matter directly. The only possibly might be that it causes usability problems because of lack of caching on subsequent page views and that indirectly harms SEO slightly. – Stephen Ostermiller Feb 22 '20 at 15:07
  • A bit confused here, expiration headers in general only refer to cache times and never refer to actual content expiration ? e.g an expired classifieds ad. – adrianTNT Feb 23 '20 at 16:15
  • Correct, which is why search engines don't use expires headers to remove content from their indexes. The only effect would be if users have to refresh pages more than they should and it makes your site slow. – Stephen Ostermiller Feb 23 '20 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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