Google bot requests are not being cached

What is the name of the domain?

What is the error message?

Google bot requests are not being cached.

What is the issue you’re encountering

Google bot requests are not being cached.

What steps have you taken to resolve the issue?

In recent weeks, we have been experiencing a significant influx of requests from GoogleBot, resulting in frequent downtime for our system. To mitigate this and prevent any negative impact on our SEO, we have decided to implement a caching strategy for all pages accessed by GoogleBot for a duration of one day. This approach is viable as the critical information on these pages seldom changes.

I am reaching out to report an issue related to the cache configuration in our account. We currently have a cache rule that specifies:
Expression: “http.user_agent contains ‘Googlebot’ and not http.request.uri.path contains ‘api’”.
Edge TTL: Ignore cache-control header and use this TTL TTL: 1 day
We recently adjusted our Cache-Control header to ensure that Googlebot requests are cached: Cache-Control: public, max-age=86400, must-revalidade, stale_shire_revalidade=60
However, analyzing the data, I observed that only AMP pages are being cached, while HTML pages are not. Could you assist us in understanding and resolving this discrepancy?

Screenshot of the error

Your HTML files all have a set-cookie header, which prevents them from being cached.

Set-Cookie:
_worldpackers_session=rPUc3Gv...
1 Like

Hello, thank you for the response. However, we have implemented a rule in our application to not have a cookie when it is a Google bot.

For those who may need it, here is an example:

  def set_cache_control
    return unless bot_request?

    request.session_options[:skip] = true
    expires_in 1.day, public: true, must_revalidate: true, stale_while_revalidate: 1.minute
  end

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.