0

We have setup varnish on our magento AWS server with nginx ssl configuration. Varnish works fine on all other pages except the homepage.

Case 1 - Refresh the page with reload button on browser - TTFB - 13 Seconds

Case 2 - Refresh the page by clicking on Home link or Logo link - TTFB - 2 ms

Huge difference between these 2 cases is our problem. We have lots of content on the homepage but it loads perfectly when reloading with home link or logo link. But when we try to reload with ctrl + R or reload button from browser it takes nearly 13-15 sec to load the page.

This is not observed on the other pages link PDP or PLP where with both cases TTFB is less than 5ms everytime.

Can anyone suggest what's the problem here?

Here's the default.vcl

https://pastebin.com/4kYZL8Tk

2
  • Add your (custom) Magento 2 VCL to the question. Sep 11, 2021 at 8:52
  • Added a default.vcl file @DanilaVershinin
    – HungryDB
    Sep 11, 2021 at 10:40

1 Answer 1

0

In terms of performance I would disregard the browser caching aspect. What matters more is whether or not Varnish caches the homepage.

Based on what I'm reading, I'm assuming this is not the case. There are various reasons for this (for example a Set-Cookie header that is set by Magento for the homepage).

Let's figure out what's going on by using varnishlog. Assuming the homepage is problematic in terms of caching, please run the following command:

varnishlog -g request -q "ReqUrl eq '/'"

This command will filter out requests for the homepage and will group output per request. Please share the logging output.

Before you run the varnishlog command, please ensure the cache is empty. We want to see logs for the first attempt at storing the homepage in cache.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.