Improve Varnish Cache Hit Rate
The Varnish Cache project provides some high level instructuions on improving cache hit rate.
The following describes the work flow with section.io metrics and development processes to acheive optimal cache hit ratios.
- Review section.io Varnish metrics
- Review logs
- Make change to VCL locally
- Confirm change has been effective - Logs
- Promote changes to Production
- Confirm change has been effective - Metrics
- Rinse and repeat
Review Varnish Metrics
Your section.io Varnish metrics provide an overview of cache hit ratios for all asset types in addtion to cache hit ratios by type.
You can use these metrics to identify an object type for which you would like the cache hit ratio to be improved.
After identifying the asset type to work on, move to logs.
You can select your development environment, push some requests through your development environment application for the type of asset you are interested in inspecting and review the Varnish Logs.
Logs are provided for the last 500 lines to provide you with quick access to your development environment debug logs. Inpspect these logs to understand the reasons for cache hit,miss or hhit for pass. More instructions are provided at improving cache hit rate.
Make Change to VCL
Modify your local VCL file. Save and fire the requests at your local instance. See Local Development <localdevelopment>.
Review logs again to confirm a change in the cache hit behaviour for the target assets.
Promote Changes to Production
If required you can test the application locally to confirm the VCL changes have not affected the functionality of the application adversely for users.
Synch your section.io repo with production and confirm cache hit rates are improving by reviewing your metrics.
Rinse and Repeat
Until you hit a desirable cache hit rate across the site.