<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cache &#8211; Rafael Bernard Araujo</title>
	<atom:link href="https://rafael.bernard-araujo.com/tag/cache/feed" rel="self" type="application/rss+xml" />
	<link>https://rafael.bernard-araujo.com</link>
	<description>desenvolvendo... while(!success){  try(); }</description>
	<lastBuildDate>Sat, 10 May 2025 23:57:57 +0000</lastBuildDate>
	<language>pt-BR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	
<site xmlns="com-wordpress:feed-additions:1">21941730</site>	<item>
		<title>Setting up maintenaince mode with Varnish</title>
		<link>https://rafael.bernard-araujo.com/setting-up-maintenaince-mode-with-varnish.php</link>
					<comments>https://rafael.bernard-araujo.com/setting-up-maintenaince-mode-with-varnish.php#respond</comments>
		
		<dc:creator><![CDATA[rafael]]></dc:creator>
		<pubDate>Wed, 17 Jan 2024 00:48:06 +0000</pubDate>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Solving Problems]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[cdn]]></category>
		<category><![CDATA[varnish]]></category>
		<category><![CDATA[vcl]]></category>
		<guid isPermaLink="false">https://rafael.bernard-araujo.com/?p=1940</guid>

					<description><![CDATA[Varnish is &#34;the free, open-source software that enables super fast delivery of HTTP or API based content&#34;, &#34;an HTTP reverse proxy that works by caching frequently requested web pages, so they can be loaded quickly without having to wait for a server response.&#34;. If you need some sort of an alternative cloud or servers in [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Varnish is <a href="https://www.varnish-software.com/products/varnish-cache/">&quot;the free, open-source software that enables super fast delivery of HTTP or API based content&quot;, &quot;an HTTP reverse proxy that works by caching frequently requested web pages, so they can be loaded quickly without having to wait for a server response.&quot;</a>.</p>
<p>If you need some sort of an alternative cloud or servers in datacenter Varnish can act as CDN, Load Balancer and Api Gateway layers at the same time. It is very powerful when you have to manage those services instead of using a Cloud service. And this is not that uncommon.</p>
<p><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/www.varnish-software.com/media/bymhguj3/varnish_v_squid_04.jpg?w=580&#038;ssl=1" alt="Varnish" /></p>
<p>Consider the use case where you need a maintenance window for a product for which you need to be sure that you are suspending all connections to the backend servers in a consistent way. Performing a redirection in the CDN layer is the better choice.</p>
<blockquote>
<p>The Varnish Configuration Language (VCL) is a domain-specific programming language used by Varnish to control request handling, routing, caching, and several other aspects.</p>
</blockquote>
<p>-- <a href="https://www.varnish-software.com/developers/tutorials/varnish-configuration-language-vcl/">https://www.varnish-software.com/developers/tutorials/varnish-configuration-language-vcl/</a></p>
<p>This is a very powerful language, that, for our use case, will allow creating a synthetic response to proxy the request to, instead of hitting the backends. There will be no need to create a web directory to be served for another web server, but just directly from Varnish.</p>
<p><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/rafael.bernard-araujo.com/wp-content/uploads/2024/01/varnish-maintenance-mode.png?w=580&#038;ssl=1" alt="" /></p>
<pre><code class="language-vcl"># default.vcl
sub vcl_synth 
{
    # previous headers manipulation if you like
    # and other code that you need for synth if you like
    # (...)

    # Adding an x-cache header to indicate this is a synth response
    set resp.http.x-cache = &quot;synth synth&quot;;

    # Maintenance - we are calling the status for this synth 911 because we can have different synths
    if ( resp.status == 911 ) {
        set resp.http.Content-Type = &quot;text/html; charset=utf-8&quot;;
        # You can put absolutely what you want
        synthetic ({&quot;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Maintenance mode - Try again later&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;h1&gt;This website is under maintenance.&lt;/h1&gt;
&lt;/body&gt;
&lt;/html&gt;
&quot;});
        return (deliver);
    }
}</code></pre>
<p>Then I can forward everything that requests my-domain.com to the maintenance</p>
<pre><code class="language-vcl"># includes/my-domain-hints.vcl

if ( req.http.host ~ &quot;my-domain.com&quot; ) {
    return(synth(911, &quot;&quot;));
    # All the other VCL configs are below here, but we are returning early above to the maintenance
    # (...)
}</code></pre>
]]></content:encoded>
					
					<wfw:commentRss>https://rafael.bernard-araujo.com/setting-up-maintenaince-mode-with-varnish.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1940</post-id>	</item>
		<item>
		<title>Tropeçando 57</title>
		<link>https://rafael.bernard-araujo.com/tropecando-57.php</link>
					<comments>https://rafael.bernard-araujo.com/tropecando-57.php#respond</comments>
		
		<dc:creator><![CDATA[rafael]]></dc:creator>
		<pubDate>Fri, 13 Sep 2013 12:52:47 +0000</pubDate>
				<category><![CDATA[Tropeçando]]></category>
		<category><![CDATA[AngularJS]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[Banco de dados]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[nosql]]></category>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[PostGreSQL]]></category>
		<category><![CDATA[svn]]></category>
		<guid isPermaLink="false">http://rafael.bernard-araujo.com/?p=1061</guid>

					<description><![CDATA[Como instalar e configurar Oracle Database 12c How To Optimize Your Site With GZIP Compression Compression is a simple, effective way to save bandwidth and speed up your site. A modern browser is needed to enjoy modern web content and modern web speed — so gzip encoding it is. Here’s how to set it up. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><a href="https://imasters.com.br/banco-de-dados/oracle/como-instalar-e-configurar-oracle-database-12c/" title="Como">Como instalar e configurar Oracle Database 12c</a></p>
</p>
<p><a href="https://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/" title="How">How To Optimize Your Site With GZIP Compression</a></p>
<blockquote>
<p>Compression is a simple, effective way to save bandwidth and speed up your site. A modern browser is needed to enjoy modern web content and modern web speed — so gzip encoding it is. Here’s how to set it up.</p>
</blockquote>
<p><a href="https://www.websiteplanet.com/webtools/gzip-compression/">Gzip Compression Checker</a></p>
<blockquote>
<p>This tool checks whether gzip compression is enabled on the web server hosting your website. After connecting to your web server, the tool\'s result page will display whether gzip is enabled and also provides additional details regarding the effectiveness of the compression and the actual savings in bandwidth for the specified page.</p>
</blockquote>
<p><a href="http://imasters.com.br/banco-de-dados/recursos-para-aprender-nosql/" title="Recursos">Recursos para aprender noSQL</a></p>
<p><a href="http://imasters.com.br/desenvolvimento/como-migrar-um-repositorio-de-codigos-svn-para-git/" title="Como">Como migrar um repositório de códigos Svn para Git</a></p>
<p><a href="https://web.archive.org/web/20190619075718/https://www.yearofmoo.com/2012/10/more-angularjs-magic-to-supercharge-your-webapp.html" title="More">More AngularJS Magic to Supercharge your Webapp</a></p>
<p><a href="https://web.archive.org/web/20140927104817/http://www.openlogic.com:80/wazi/bid/188074/Window-Functions-PostgreSQL-s-Best-Kept-Secret">Window Functions: PostgreSQL's Best-Kept Secret</a></p>
<p><a href="http://postgresguide.com/tips/window.html" title="Window">Window Functions</a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://rafael.bernard-araujo.com/tropecando-57.php/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1061</post-id>	</item>
	</channel>
</rss>
