Hot answers tagged

5

After waiting on this question, I gathered some of the concept of warm and cold cache. By caching copies of image files, CSS, and HTML documents, the origin server does not have to generate these files each time a new visitor comes to the website. This both improves page load time and decreases stress on the origin server, meaning a website can serve more ...


3

The env.php should have: 'http_cache_hosts' => array ( 0 => array ( 'host' => '127.0.0.1', 'port' => '80', ), ), It should point to Varnish which I think in your setup listens on port 80. Currently you got it wrong because you have port 8080 in your env.php (It’s pointing to backend of Varnish)


3

To make Magento aware of the Varnish servers, add the following section to app/etc/env.php. For Example: 'http_cache_hosts' => array ( 0 => array ( 'host' => 'varnish-0', 'port' => '80', ), 1 => array ( 'host' => 'varnish-1', 'port' => '80', ), ), In order to ensure the Varnish cache ...


2

Try this, Method 1: Add the below code to homepage cms under <referenceContainer name="content"> <block cacheable="false"/> </referenceContainer> content -> pages -> select homepage -> under design tab -> Layout update xml Method 2 : If you want it via xml in the sense add the below code into <?xml version="1.0"?> <page ...


1

your development must be separated from live. it is better for security and maintenance. just copy your magento installation to another account / home folder. copy nginx config, update root, domain and base url. in varnish you need to add either one: full domain bypass: if (req.http.host ~ "^dev\.example\.com$") { return (pass); } or parameter ?developer ...


1

Easy fix. Configure your default.vcl thats located in /etc/varnish/ with the following: Find # Bypass shopping cart, checkout and search requests if (req.url ~ "/checkout" || req.url ~ "/catalogsearch" ) { return (pass); } Change it with the following: # Bypass shopping cart, checkout and search requests if (req.url ~ "/checkout" |...


1

Unfortunately changes in product data to configuration changes to automated processes such as currency updates will invalidate cache. We had this on a magento 1 store and sounds like pretty much the same scenario in magento 2. My best advice is create a console command which curls varnish via php curl -X PURGE http://example.com/url1 I believe if you do ...


1

follow these steps: https://www.cloudways.com/blog/magento-2-varnish-setup/ install varnish cache in Magento store. You need to make some minimal changes in configuration as per store requirements.


1

Both are the Server Level Cache: When you are using 2 server cache at one time, It may generate conflict at some place. And in your Case it is Generating problem at your Back-end (Admin Page) Kindly please Enable only one Server Cache. From my Point of View Varnish Cache(HTTP Reverse Proxy) have better Performance. Also you can use one Browser Level ...


1

I resolved the issue by using widget and cms block concept. Since widget is working via the ajax request, that's a power of widget!. Magento 2.2.7 Version Step 1: Module file path : root/app/Code/Faceless/RecentlyViewed/Setup/UpgradeData.php <?php namespace Faceless\RecentlyViewed\Setup; use Magento\Framework\Setup\ModuleContextInterface; use ...


1

you need to use varnish port 6081 to proxy https location / { proxy_pass http://127.0.0.1:6081; user -> nginx:80 -> nginx:443 -> varnish:6081 -> nginx:8080


1

varnish itself not working with ssl. configure ssl terminator in front if you have small traffic shop with little orders you can safely use file cache. varnish cache is a must have for high traffic shops.


1

Varnish openly does not support HTTPS, more about this can be found here There are multiple highly documented pages about Magento2 and Varnish as well as configuring Varnish for Magento2 here The most common approach is to use a reverse proxy that is introduce a "front man server" that talks to the internet over HTTPS and forwards the calls to the "worker ...


1

to help you debug this, you can add this php file for example, headers.php: <?php foreach($_SERVER as $key_name => $key_value) { print $key_name . " = <font style='color: rgb(0,0,255);'>" . $key_value . "</font><br/>"; } ?> where you can see all the headers. make sure you proxy pass correct header: proxy_set_header X-...


1

Change indexing settings to Update on schedule and do indexing by ssh menually.


1

According to Magento, you can perform some final verifications to make sure Varnish is working. One of which is Verifying HTTP response headers First, make sure you are using Magento’s developer mode; otherwise, you won’t see the headers. For example, curl -I -v --location-trusted 'http://192.0.2.55/magento2' Important headers: X-Magento-Cache-...


1

You need to follow Magento 2 devdocs as they told step to step setting and configuration of varnish cache. If you have already installed varnish cache on your server then you need to configure Port in admin of Developer section then you will require to final verification that it's working or not as per below guideline of Devdoc Magento 2: https://devdocs....


1

Oke I found out what was wrong! For some reason the vary User-Agent made it so that Varnish cached based on the user agent. So each individual had a different Varnish version cached. This is obviously not the point of Varnish since that it just works on each person instead of them all. So removing the "User-Agent" in the .htaccess fixed the issue! I just ...


1

The best way that I've found to do this is to write a PHP script that utilizes the AWS PHP SDK to get a list of all the current instances of your auto-scaling group: https://docs.aws.amazon.com/aws-sdk-php/v3/api/api-autoscaling-2011-01-01.html#describeautoscalinggroups That PHP script can then use the command you mentioned on all the production instances. ...


1

Nothing's wrong. X-Varnish will not be present in the output, because the following VCL code unsets it: unset resp.http.X-Varnish;


1

To resolve this problem, you can override the default.xml file and remove it inside the ttl tag of the topmenu block, this xml find in Vendor/Magento/module-theme/view/frontend/layout.


1

I feel, the answer whatever you have posted is not relevant to your question. Mainly Hole punching is used to make some specific block to show non-cached information which is part of cached page. Please be clear on your question & answer. And you can check "sections on magento 2" for achieving hole-punching functionalities.


Only top voted, non community-wiki answers of a minimum length are eligible