How does the Full Page Cache Warmer extension work with Varnish Cache?

How does the Full Page Cache Warmer extension work with Varnish Cache?

The Full Page Cache Warmer doesn't handle the cache, it just warms the pages by imitating the entrance of the real person on the website.

The Full Page Cache Warmer extension is compatible with the Varnish. By default, the extension works with the Magento cache table and takes URLs from the url_rewrite table in order to warm them.

The extension sends requests to the Varnish and if the page is not cached the extension will warm it. 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. The following figure shows a basic view of Varnish in the Magento topology:


As you can see there is a gap between Magento and users' requests. This gap is filled by Varnish.

In the preceding figure, users’ HTTP requests over the internet result in numerous requests for CSS, HTML, JavaScript, and images (referred to collectively as assets). Varnish sits in front of the webserver and proxies these requests to the webserver.

As the webserver returns assets, cacheable assets are stored in Varnish. Any subsequent requests for those assets are fulfilled by Varnish (meaning, the requests don’t reach the webserver). Varnish returns cached content extremely quickly. The results are faster response times to return the content to users and a reduced number of requests that must be fulfilled by Magento.

According to the above, the Warmer extension is not able to identify whether the page is cached since the cache is being stored in Varnish, and on the storefront, Varnish cache status is always displayed as Miss.