Troubleshooting for pages with high traffic
If the index page has a low hit rate, you can fix it by reducing the amount of heavily-updated data present on that page.
Step 2: Check the overall site cache hit rate
To check the overall cache hit rate:
-
Get Fastly credentials for your Adobe Commerce on cloud infrastructure environment.
-
Run the following Linux/macOS cURL command to check the hit rate for your site over the last 30 minutes, replacingand with the values for your Fastly credentials:
curl -H "Fastly-Key: " https://api.fastly.com/stats/service//field/hit_ratio?by=minute | json_pp
You can also check historical hit rates over the last day or month by changing the time range query option from
?by=minute
to?by=hour
or?by=day
. For more information on getting Fastly cache stats, see Query Options in the Fastly documentation.The
| json_pp
option pretty prints the JSON response output using thejson_pp
utility. If you get a_‘json_pp not found’_ error, install thejson_pp
utility, or use another command line tool for JSON pretty printing. Alternatively, delete the| json_pp
parameter and run the command again. The JSON response output is not formatted, but you can run it through a JSON beautifier to clean it up.
A hit rate above 0.90 or 90% indicates that the full-page cache is working.
A hit rate below 0.85 or 85% might indicate a site configuration problem, or you might have a third-party extension installed that does not allow its content to be cached.