<?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: How to Cache Content in NGINX	</title>
	<atom:link href="https://www.tecmint.com/cache-content-with-nginx/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecmint.com/cache-content-with-nginx/</link>
	<description>Tecmint - Linux Howtos, Tutorials, Guides, News, Tips and Tricks.</description>
	<lastBuildDate>Tue, 16 Mar 2021 14:06:10 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
	<item>
		<title>
		By: boppy		</title>
		<link>https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1451911</link>

		<dc:creator><![CDATA[boppy]]></dc:creator>
		<pubDate>Tue, 16 Mar 2021 14:06:10 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=37802#comment-1451911</guid>

					<description><![CDATA[Some notes:
&lt;ul&gt;
&lt;li&gt;You should use `&lt;strong&gt;$is_args$args&lt;/strong&gt;` to only append the ? where needed in Codeblock 1 (and others).&lt;/li&gt;
&lt;li&gt;While using &lt;strong&gt;~&lt;/strong&gt; for regex keep in mind that &lt;strong&gt;&quot;.&quot;&lt;/strong&gt; is &quot;&lt;strong&gt;any char&lt;/strong&gt;&quot; not a period (use &lt;strong&gt;&quot;\.&quot;&lt;/strong&gt; to match a period)!.&lt;/li&gt;
&lt;li&gt;The example for skipping POST requests is not the best, because by default only HEAD and GET requests are cached anyway.&lt;/li&gt;
&lt;li&gt;The directive `&lt;strong&gt;fastcgi_cache_purge&lt;/strong&gt;` is only available at commercial subscriptions, so not available to most users.&lt;/li&gt;
&lt;li&gt;The merged list of file endings right before &quot;&lt;strong&gt;Enabling Proxy Cache in NGINX&lt;/strong&gt;&quot; contains spaces, so the extensions are not matched.&lt;/li&gt;
&lt;li&gt;The last location in the block right before &lt;strong&gt;&quot;Enabling Proxy Cache in NGINX&quot;&lt;/strong&gt; should match ANY location beside the root page, because any location contains a &quot;/&quot; any &quot;any character&quot;.&lt;/li&gt;
&lt;/ul&gt;]]></description>
			<content:encoded><![CDATA[<p>Some notes:</p>
<ul>
<li>You should use `<strong>$is_args$args</strong>` to only append the ? where needed in Codeblock 1 (and others).</li>
<li>While using <strong>~</strong> for regex keep in mind that <strong>&#8220;.&#8221;</strong> is &#8220;<strong>any char</strong>&#8221; not a period (use <strong>&#8220;\.&#8221;</strong> to match a period)!.</li>
<li>The example for skipping POST requests is not the best, because by default only HEAD and GET requests are cached anyway.</li>
<li>The directive `<strong>fastcgi_cache_purge</strong>` is only available at commercial subscriptions, so not available to most users.</li>
<li>The merged list of file endings right before &#8220;<strong>Enabling Proxy Cache in NGINX</strong>&#8221; contains spaces, so the extensions are not matched.</li>
<li>The last location in the block right before <strong>&#8220;Enabling Proxy Cache in NGINX&#8221;</strong> should match ANY location beside the root page, because any location contains a &#8220;/&#8221; any &#8220;any character&#8221;.</li>
</ul>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aaron Kili		</title>
		<link>https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1396925</link>

		<dc:creator><![CDATA[Aaron Kili]]></dc:creator>
		<pubDate>Tue, 01 Dec 2020 06:05:34 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=37802#comment-1396925</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1395391&quot;&gt;simplyboy&lt;/a&gt;.

@simplyboy

You may want to contact the developers of woo-commerce about the dangers of using FastCGI caching with woo commerce.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1395391">simplyboy</a>.</p>
<p>@simplyboy</p>
<p>You may want to contact the developers of woo-commerce about the dangers of using FastCGI caching with woo commerce.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: simplyboy		</title>
		<link>https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1395391</link>

		<dc:creator><![CDATA[simplyboy]]></dc:creator>
		<pubDate>Fri, 27 Nov 2020 16:40:17 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=37802#comment-1395391</guid>

					<description><![CDATA[hey,

thanks for the tutorial.

I&#039;m a little worried about my woo-commerce store. I heard it is a little dangerous to use FastCGI caching with the woo commerce some of the problems can not resolve %100.

So my question is could you provide me with woocommerce FastCGI caching rules?

I should add woocommerce_cart?


&lt;code&gt;	if ($request_uri ~* &quot;/wp-admin/&#124;/xmlrpc.php&#124;wp-.*.php&#124;/feed/&#124;index.php &#124;sitemap(_index)?.xml&quot;) { 
		set $skip_cache 1; 
	} 
	# Don&#039;t use the cache for logged-in users or recent commenters 
	if ($http_cookie ~* &quot;comment_author&#124;wordpress_[a-f0-9]+&#124;wp-postpass &#124;wordpress_no_cache&#124;wordpress_logged_in&quot;) {
		set $skip_cache 1; 
	}&lt;/code&gt;]]></description>
			<content:encoded><![CDATA[<p>hey,</p>
<p>thanks for the tutorial.</p>
<p>I&#8217;m a little worried about my woo-commerce store. I heard it is a little dangerous to use FastCGI caching with the woo commerce some of the problems can not resolve %100.</p>
<p>So my question is could you provide me with woocommerce FastCGI caching rules?</p>
<p>I should add woocommerce_cart?</p>
<p><code>	if ($request_uri ~* "/wp-admin/|/xmlrpc.php|wp-.*.php|/feed/|index.php |sitemap(_index)?.xml") {<br />
		set $skip_cache 1;<br />
	}<br />
	# Don't use the cache for logged-in users or recent commenters<br />
	if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass |wordpress_no_cache|wordpress_logged_in") {<br />
		set $skip_cache 1;<br />
	}</code></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Aaron Kili		</title>
		<link>https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1366297</link>

		<dc:creator><![CDATA[Aaron Kili]]></dc:creator>
		<pubDate>Tue, 22 Sep 2020 05:04:28 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=37802#comment-1366297</guid>

					<description><![CDATA[In reply to &lt;a href=&quot;https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1365398&quot;&gt;Mel&lt;/a&gt;.

@Mel

Try this:
&lt;pre&gt;
    location ~* .(ogg&#124;ogv&#124;svg&#124;svgz&#124;eot&#124;otf&#124;woff&#124;mp4&#124;ttf&#124;css&#124;rss&#124;atom&#124;js&#124;jpg
                  &#124;jpeg&#124;gif&#124;png&#124;ico&#124;zip&#124;tgz&#124;gz&#124;rar&#124;bz2&#124;doc&#124;xls&#124;exe&#124;ppt&#124;tar&#124;mid
                  &#124;midi&#124;wav&#124;bmp&#124;rtf)$ {
        expires max;
        log_not_found off;
        access_log off;
    }
&lt;/pre&gt;
Restart your nginx service after making changes.]]></description>
			<content:encoded><![CDATA[<p>In reply to <a target="_blank" href="https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1365398">Mel</a>.</p>
<p>@Mel</p>
<p>Try this:</p>
<pre>
    location ~* .(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg
                  |jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid
                  |midi|wav|bmp|rtf)$ {
        expires max;
        log_not_found off;
        access_log off;
    }
</pre>
<p>Restart your nginx service after making changes.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Mel		</title>
		<link>https://www.tecmint.com/cache-content-with-nginx/comment-page-1/#comment-1365398</link>

		<dc:creator><![CDATA[Mel]]></dc:creator>
		<pubDate>Sat, 19 Sep 2020 12:38:14 +0000</pubDate>
		<guid isPermaLink="false">https://www.tecmint.com/?p=37802#comment-1365398</guid>

					<description><![CDATA[Hi Team,

I have added the below code for caching but it&#039;s not working, please suggest.
&lt;pre&gt;
location ~* \.(jpg&#124;jpeg&#124;gif&#124;png&#124;ico&#124;cur&#124;gz&#124;svg&#124;svgz&#124;mp4&#124;ogg&#124;ogv&#124;webm&#124;htc&#124;svg&#124;woff&#124;woff2&#124;ttf)\$ {
      etag on;
      if_modified_since exact;
      expires 30d;
      #add_header Pragma &quot;public&quot;;
      add_header Cache-Control &quot;public, no-transform&quot;;
    }
&lt;/pre&gt;
Regards,
Mel]]></description>
			<content:encoded><![CDATA[<p>Hi Team,</p>
<p>I have added the below code for caching but it&#8217;s not working, please suggest.</p>
<pre>
location ~* \.(jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|svg|woff|woff2|ttf)\$ {
      etag on;
      if_modified_since exact;
      expires 30d;
      #add_header Pragma "public";
      add_header Cache-Control "public, no-transform";
    }
</pre>
<p>Regards,<br />
Mel</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
