Skip to content
This repository has been archived by the owner on Dec 19, 2019. It is now read-only.

Spike Varnish Testing

Anusha Vattam edited this page Mar 28, 2019 · 3 revisions

Investigating on Spike - Varnish testing#516

What is Varnish Cache?

Varnish Cache is an open source web application accelerator (also referred to as an HTTP accelerator or caching HTTP reverse proxy). Varnish stores (or caches) files or fragments of files in memory; this enables Varnish to reduce the response time and network bandwidth consumption on future, equivalent requests. Unlike web servers like Apache and nginx, Varnish was designed for use exclusively with the HTTP protocol.

Why do we need it?

With applications like Magento, it is more important to have the cache as it drastically reduces the load on the application and speeds up the page response, thus yielding a better user experience.

Preconditions: Install Magento 2.3.1 with varnish.

https://devdocs.magento.com/guides/v2.3/config-guide/varnish/config-varnish.html

Questions: Manual testing is good or do we need any automated tests like example:web API functional test?

Manually: Check for the response Headers and response times by following:

You can check Varnish headers if you want to see if caching is working correctly. Use any developer tool or Curl command and look for “X-­Magento-­Cache-­Debug:” header. If you see “HIT”/"MISS" as the value of the mentioned header, then it’s working, You need to be in Developer mode to see Debug Header.

Also check this: https://devdocs.magento.com/guides/v2.3/config-guide/varnish/config-varnish-final.html

X-Magento-Cache-Control: max-age=86400, public, s-maxage=86400 Age: 0 X-Magento-Cache-Debug: MISS/HIT

Automation: Able to create API tests for the Varnish support.

Changes must be covered with web API functional test. Make sure that Varnish cache works for products queries and invalidates properly on the related product modifications

Clone this wiki locally