huguesalary / Magento-Varnish

This Magento extension provides a Real Full Page Caching for Magento powered by Varnish with support of Session-Based information caching (Cart, Customer Accounts, ...) via ESI includes
Other
95 stars 18 forks source link

Flushing cache provides to error #14

Closed devzorg closed 12 years ago

devzorg commented 12 years ago

There was an error when refreshing: Error 405 Not allowed. Not allowed. Guru Meditation: XID: 48798421 Varnish cache server

Why flush is restricted? What need to check ?

huguesalary commented 12 years ago

I guess Varnish is not installed on the same server as Apache. In that case you need to edit the varnish configuration file (most likely to be default.vcl) and add the IP address of your apache server in the acl ban

acl ban {
    /* Access List for the BAN requests */
    "127.0.0.1";
    "your_apache server address here";
}

acl debugACL {
    /* List of IP that will get the debug headers */
    "127.0.0.1";
}

Save the config and reload it by connecting on your varnishadm console or by restarting varnish.

devzorg commented 12 years ago

Yes thanks, i have solved it, it need to set LAN interface IP instead 127.0.0.1

But i have experienced challenges with esi blocks e.g. cart_sidebar should not cached, how do it ?

huguesalary commented 12 years ago

I would recommend to cache cart_sidebar. The extension takes care of flushing it when the cart is modified. If you don't cache the cart_sidebar all the pages where the cart_sidebar is present will be slow as the cart will have to be regenerated at each page view.

If you really don't want to cache it, edit the varnish.xml frontend layout file and remove these lines:

<!-- The cart sidebar is cached on a per-client basis-->
<reference name="cart_sidebar">
    <action method="setEsi">
        <params>
           <cache_type>per-client</cache_type>
        </params>
     </action>
</reference>