<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Magento performance optimization with Varnish cache</title>
	<atom:link href="http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/feed" rel="self" type="application/rss+xml" />
	<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html</link>
	<description>Articles about Magento, Varnish, PHP, MySQL</description>
	<lastBuildDate>Fri, 17 Feb 2012 09:13:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: jrosell</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-314</link>
		<dc:creator>jrosell</dc:creator>
		<pubDate>Fri, 25 Nov 2011 18:36:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-314</guid>
		<description>Is possible to install it on Magento CE 1.6?</description>
		<content:encoded><![CDATA[<p>Is possible to install it on Magento CE 1.6?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Getting Varnish To Work on Magento &#124; Coding Answers</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-275</link>
		<dc:creator>Getting Varnish To Work on Magento &#124; Coding Answers</dc:creator>
		<pubDate>Fri, 20 May 2011 08:45:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-275</guid>
		<description>[...] I am following the example at: http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html [...]</description>
		<content:encoded><![CDATA[<p>[...] I am following the example at: <a href="http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html" rel="nofollow">http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: COBAY</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-268</link>
		<dc:creator>COBAY</dc:creator>
		<pubDate>Wed, 04 May 2011 09:38:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-268</guid>
		<description>Thank you for your code ~~~
You&#039;re great !</description>
		<content:encoded><![CDATA[<p>Thank you for your code ~~~<br />
You&#8217;re great !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-262</link>
		<dc:creator>Mario</dc:creator>
		<pubDate>Thu, 17 Feb 2011 21:51:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-262</guid>
		<description>Hi Josh,

Be careful with Varnish because it is standard compliant and it will listen to your cache control headers.

If you really want to instruct Varnish to ignore headers or cookies, use something like this in your Varnish configuration:

sub vcl_recv {
 //... 
 // you decide to cache
  # Remove cookie
    unset req.http.Cookie;

    return (lookup);
}

Here you can manipulate response headers (modify it to your needs):
sub vcl_fetch {
  set obj.grace = 300s;
  set obj.http.X-Cache-Set = &quot;NO:Not-Cacheable&quot;;

  if (obj.status &gt;= 300) {
    // if the request from backend is not 2xx, don&#039;t cache
    set obj.http.X-Cache-Set = &quot;NO: Non 200 Code&quot;;
    pass;
  }

  ## Cache static content
  if (req.request == &quot;GET&quot; &amp;&amp; (
          req.url ~ &quot;\.(gif&#124;jpg&#124;jpeg&#124;bmp&#124;png&#124;tiff&#124;tif&#124;ico&#124;img&#124;tga&#124;wmf)$&quot;
       &#124;&#124; req.url ~ &quot;\.(svg&#124;swf&#124;ico&#124;mp3&#124;mp4&#124;m4a&#124;ogg&#124;mov&#124;avi&#124;wmv)$&quot;
       &#124;&#124; req.url ~ &quot;\.(js&#124;css&#124;xml&#124;txt&#124;pdf&#124;pls&#124;torrent&#124;gz&#124;zip&#124;rar&#124;bz2&#124;tgz&#124;tbz)$&quot;
       &#124;&#124; req.url ~ &quot;^/store/(skin&#124;js&#124;media)/.*&quot;
      )) {
    set obj.ttl = 1800s;
    set obj.http.Cache-Control = &quot;max-age = 1800&quot;;
    set obj.cacheable = true;
    set obj.http.X-Cache-Set = &quot;YES: Static&quot;;
    # remove cache headers set by Magento
    unset obj.http.Pragma;
    unset obj.http.Set-Cookie;
  }


I recommend you to enable this and check X-Cache header:
## Called before a cached object is delivered to the client
#
sub vcl_deliver {

  set resp.http.X-Served-By = &quot;add FE name here&quot;;

  if (obj.hits &gt; 0) {
      set resp.http.X-Cache = &quot;HIT&quot;;
      set resp.http.X-Cache-Hits = obj.hits;
  } else {
      set resp.http.X-Cache = &quot;MISS&quot;;
  }
}

New version of Varnish expose only some specific objects in these functions. Please check the docs, http://www.varnish-cache.org/trac/wiki/VCL.

Hope this is a good start to hack your Varnish configuration.

Good luck ;)</description>
		<content:encoded><![CDATA[<p>Hi Josh,</p>
<p>Be careful with Varnish because it is standard compliant and it will listen to your cache control headers.</p>
<p>If you really want to instruct Varnish to ignore headers or cookies, use something like this in your Varnish configuration:</p>
<p>sub vcl_recv {<br />
 //&#8230;<br />
 // you decide to cache<br />
  # Remove cookie<br />
    unset req.http.Cookie;</p>
<p>    return (lookup);<br />
}</p>
<p>Here you can manipulate response headers (modify it to your needs):<br />
sub vcl_fetch {<br />
  set obj.grace = 300s;<br />
  set obj.http.X-Cache-Set = &#8220;NO:Not-Cacheable&#8221;;</p>
<p>  if (obj.status &gt;= 300) {<br />
    // if the request from backend is not 2xx, don&#8217;t cache<br />
    set obj.http.X-Cache-Set = &#8220;NO: Non 200 Code&#8221;;<br />
    pass;<br />
  }</p>
<p>  ## Cache static content<br />
  if (req.request == &#8220;GET&#8221; &amp;&amp; (<br />
          req.url ~ &#8220;\.(gif|jpg|jpeg|bmp|png|tiff|tif|ico|img|tga|wmf)$&#8221;<br />
       || req.url ~ &#8220;\.(svg|swf|ico|mp3|mp4|m4a|ogg|mov|avi|wmv)$&#8221;<br />
       || req.url ~ &#8220;\.(js|css|xml|txt|pdf|pls|torrent|gz|zip|rar|bz2|tgz|tbz)$&#8221;<br />
       || req.url ~ &#8220;^/store/(skin|js|media)/.*&#8221;<br />
      )) {<br />
    set obj.ttl = 1800s;<br />
    set obj.http.Cache-Control = &#8220;max-age = 1800&#8243;;<br />
    set obj.cacheable = true;<br />
    set obj.http.X-Cache-Set = &#8220;YES: Static&#8221;;<br />
    # remove cache headers set by Magento<br />
    unset obj.http.Pragma;<br />
    unset obj.http.Set-Cookie;<br />
  }</p>
<p>I recommend you to enable this and check X-Cache header:<br />
## Called before a cached object is delivered to the client<br />
#<br />
sub vcl_deliver {</p>
<p>  set resp.http.X-Served-By = &#8220;add FE name here&#8221;;</p>
<p>  if (obj.hits &gt; 0) {<br />
      set resp.http.X-Cache = &#8220;HIT&#8221;;<br />
      set resp.http.X-Cache-Hits = obj.hits;<br />
  } else {<br />
      set resp.http.X-Cache = &#8220;MISS&#8221;;<br />
  }<br />
}</p>
<p>New version of Varnish expose only some specific objects in these functions. Please check the docs, <a href="http://www.varnish-cache.org/trac/wiki/VCL" rel="nofollow">http://www.varnish-cache.org/trac/wiki/VCL</a>.</p>
<p>Hope this is a good start to hack your Varnish configuration.</p>
<p>Good luck <img src='http://www.kalenyuk.com.ua/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Josh Pennington</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-261</link>
		<dc:creator>Josh Pennington</dc:creator>
		<pubDate>Thu, 17 Feb 2011 15:09:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-261</guid>
		<description>I am trying to get this up and running and I have a few issues. It looks like in my headers I have a few cookies and then there are some cache control headers.

Can anyone tell me how to get Varnish to ignore these things?</description>
		<content:encoded><![CDATA[<p>I am trying to get this up and running and I have a few issues. It looks like in my headers I have a few cookies and then there are some cache control headers.</p>
<p>Can anyone tell me how to get Varnish to ignore these things?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mario</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-260</link>
		<dc:creator>Mario</dc:creator>
		<pubDate>Wed, 16 Feb 2011 21:27:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-260</guid>
		<description>Some ideas how to extend this this here: http://moprea.ro/2011/feb/16/magento-performance-optimization-varnish-cache-2/

Purges only urls that needs to be refreshed ;)</description>
		<content:encoded><![CDATA[<p>Some ideas how to extend this this here: <a href="http://moprea.ro/2011/feb/16/magento-performance-optimization-varnish-cache-2/" rel="nofollow">http://moprea.ro/2011/feb/16/magento-performance-optimization-varnish-cache-2/</a></p>
<p>Purges only urls that needs to be refreshed <img src='http://www.kalenyuk.com.ua/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jan</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-257</link>
		<dc:creator>Jan</dc:creator>
		<pubDate>Fri, 31 Dec 2010 04:13:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-257</guid>
		<description>How is possible to run it? I made changes in Magento and install Varnish properly. There were few errors in varnish.vcl file. I have to remove 

#      purge_hash(&quot;.*&quot;);
And 
#include
#include

After that varnish started properly. And is listening on port. I am running nginx. How can I start nginx with Varnish support?</description>
		<content:encoded><![CDATA[<p>How is possible to run it? I made changes in Magento and install Varnish properly. There were few errors in varnish.vcl file. I have to remove </p>
<p>#      purge_hash(&#8220;.*&#8221;);<br />
And<br />
#include<br />
#include</p>
<p>After that varnish started properly. And is listening on port. I am running nginx. How can I start nginx with Varnish support?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: André Zaiats</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-251</link>
		<dc:creator>André Zaiats</dc:creator>
		<pubDate>Mon, 15 Nov 2010 15:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-251</guid>
		<description>This is working on magento 1.4.1.1? 

I guess here, observer isn&#039;t working, cause I can&#039;t see the nocache cookie seted. Even if I modify the code and put garbage on it, magento runs fine, what makes me think the code isnt&#039; called at all.

Any clues someone?</description>
		<content:encoded><![CDATA[<p>This is working on magento 1.4.1.1? </p>
<p>I guess here, observer isn&#8217;t working, cause I can&#8217;t see the nocache cookie seted. Even if I modify the code and put garbage on it, magento runs fine, what makes me think the code isnt&#8217; called at all.</p>
<p>Any clues someone?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: aqq</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-248</link>
		<dc:creator>aqq</dc:creator>
		<pubDate>Fri, 05 Nov 2010 10:27:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-248</guid>
		<description>how did you solve #20?</description>
		<content:encoded><![CDATA[<p>how did you solve #20?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesús</title>
		<link>http://www.kalenyuk.com.ua/magento-performance-optimization-with-varnish-cache-47.html/comment-page-1#comment-242</link>
		<dc:creator>Jesús</dc:creator>
		<pubDate>Fri, 29 Oct 2010 07:41:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.kalenyuk.com.ua/?p=47#comment-242</guid>
		<description>#20 Solved</description>
		<content:encoded><![CDATA[<p>#20 Solved</p>
]]></content:encoded>
	</item>
</channel>
</rss>

