Fastly backend checks in Adobe Commerce on Cloud infrastructure

Backend checks with Fastly tester tool may display errors related to cacheability and surrogate keys. This article outlines the steps to resolve such errors in Adobe Commerce on Cloud infrastructure.

Description description

Environment

Adobe Commerce on Cloud infrastructure v2.4.7

Issue

When using the Fastly Tester tool, errors appear for backend checks related to cacheability and surrogate keys. You can see the following:

  • The Cacheable  and Surrogate Keys  options appear in red on the Fastly Tester.
  • There is a discrepancy between test results from the tool hosted on fastly.net and direct cURL command outputs.

Resolution resolution

  1. Verify cache settings to ensure your backend doesn’t respond with headers like cache-control: max-age=0, must-revalidate, no-cache, or no-store. It’s because these settings prevent caching by marking responses as private or non-cacheable.

  2. Confirm the latest Varnish Configuration Language (VCL) snippet is correctly uploaded in your module configuration settings.

  3. Verify you are using the latest version of the Fastly Magento 2 module across all environments, including Staging and Production.

  4. Instead of relying solely on the Fastly Tester tool, use direct cURL commands to verify cache behavior. This command provides accurate information about surrogate keys and caching status from the server response headers.

    curl -D - -o /dev/null <your-url> -H 'Fastly-Debug:1' -s

  5. If issues persist, contact technical support for further assistance or clarification regarding specific configurations or unexpected behaviors during tests.

recommendation-more-help
3d58f420-19b5-47a0-a122-5c9dab55ec7f