Showing results for 
Search instead for 
Did you mean: 

Varnish PageCache Test result "Expected HIT on the second page load"

Varnish PageCache Test result "Expected HIT on the second page load"

I have created a custom module for filter some product collection.

When I try to upload this extension to Magento marketplace. I pass the reviews Marketing Review, Code Sniffer and Copy Paste Detector. but facing an error on Installation & Varnish Test section.
The error is

Expected HIT on the second page load after product price update.
My extension has including Controller, Model, Observer and Plugin folders. not overriding any block from the extension.
Thanks in advance.

Re: Varnish PageCache Test result "Expected HIT on the second page load"

You can setup the Varnish cache on your server and Test it.

Main file is default.vcl so you need to follow below steps for testing in any particular magento.

Log in to the Magento Admin as an administrator.
Click Stores > Settings > Configuration > Advanced > System > Full Page Cache.
From the Caching Application list, click Varnish Caching.
Enter a value in the TTL for public content field.


The Varnish test also uses the :

php bin/magento setup:performance:generate-fixtures

command to install sample products to run the test against magento using file ./varnish-config/profile.xml

./varnish-config/profile.xml file contents : 

<?xml version="1.0"?>
<config xmlns:xi="">
        <admin_users>1</admin_users> <!--  Number of admin users to generate -->
        <websites>1</websites> <!--  Number of websites to generate -->
        <store_groups>1</store_groups> <!--Number of stores-->
        <store_views>1</store_views> <!--  Number of store views -->
        <assign_entities_to_all_websites>0</assign_entities_to_all_websites> <!--  Whether to assign all products per each website -->
        <simple_products>10</simple_products> <!--  Simple products count -->
        <categories>2</categories> <!--  Number of categories to generate -->
        <configs> <!--  Config variables and values -->

Above code is already added to default.vcl

sub vcl_deliver {
    if (resp.http.x-varnish ~ " ") {
        set resp.http.X-EQP-Cache = "HIT";
    } else {
        set resp.http.X-EQP-Cache = "MISS";

Also in frontend in network you can check X-EQP-Cache = "HIT" or X-EQP-Cache = "MISS" to chek if varnish is implemented.

Please check the Reference Image :

You can Take the references from the Below Links : 

Click on 'Kudos' & Accept as Solution to encourage to write more answers !