<?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>Content delivery network &#8211; stoimen&#039;s web log</title>
	<atom:link href="/tag/content-delivery-network/feed/" rel="self" type="application/rss+xml" />
	<link></link>
	<description>on web development</description>
	<lastBuildDate>Tue, 13 Feb 2018 08:18:15 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=5.0.3</generator>
	<item>
		<title>Use Cookie-Free Domain and CDN for Static Content!</title>
		<link>/2010/03/12/use-cookie-free-domain-and-cdn-for-static-content/</link>
		<comments>/2010/03/12/use-cookie-free-domain-and-cdn-for-static-content/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 08:46:32 +0000</pubDate>
		<dc:creator><![CDATA[Stoimen]]></dc:creator>
				<category><![CDATA[web development]]></category>
		<category><![CDATA[Content delivery network]]></category>
		<category><![CDATA[cookie]]></category>
		<category><![CDATA[Cookies]]></category>
		<category><![CDATA[HTTP cookie]]></category>
		<category><![CDATA[MySQL Americas Inc.]]></category>
		<category><![CDATA[Networks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[server site]]></category>
		<category><![CDATA[Technology/Internet]]></category>
		<category><![CDATA[web developers]]></category>
		<category><![CDATA[Web page]]></category>
		<category><![CDATA[Yahoo! Inc.]]></category>
		<category><![CDATA[YouTube Inc]]></category>

		<guid isPermaLink="false">/?p=1220</guid>
		<description><![CDATA[Benefits from Cookie-Free Domains Lately most of the web developers are talking more and more about optimization. One of the practices everybody&#8217;s supporting is to use cookie free domains for static content. First of all, what&#8217;s static content. That, in breve, are all images, JavaScripts and CSS. That&#8217;s everything that&#8217;s transmitted to the client with &#8230; <a href="/2010/03/12/use-cookie-free-domain-and-cdn-for-static-content/" class="more-link">Continue reading <span class="screen-reader-text">Use Cookie-Free Domain and CDN for Static Content!</span> <span class="meta-nav">&#8594;</span></a><div class='yarpp-related-rss'>

Related posts:<ol>
<li><a href="/2009/04/15/read-the-anchor-part-of-the-url-with-php/" rel="bookmark" title="Read The Anchor Part of The URL &#8230; with PHP">Read The Anchor Part of The URL &#8230; with PHP </a></li>
<li><a href="/2010/11/03/how-to-overcome-zend_cache_frontend_pages-problem-with-cookies/" rel="bookmark" title="How to Overcome Zend_Cache_Frontend_Page&#8217;s Problem with Cookies">How to Overcome Zend_Cache_Frontend_Page&#8217;s Problem with Cookies </a></li>
<li><a href="/2011/04/05/jquery-unbind/" rel="bookmark" title="jQuery.unbind()">jQuery.unbind() </a></li>
<li><a href="/2010/03/23/read-remote-file-content-type-with-zend_http_client/" rel="bookmark" title="Read Remote File Content-Type with Zend_Http_Client">Read Remote File Content-Type with Zend_Http_Client </a></li>
</ol>
</div>
]]></description>
				<content:encoded><![CDATA[<h2>Benefits from Cookie-Free Domains</h2>
<p>Lately most of the web developers are talking more and more about optimization. One of the practices everybody&#8217;s supporting is to use cookie free domains for static content. First of all, what&#8217;s static content. That, in breve, are all images, JavaScripts and CSS. That&#8217;s everything that&#8217;s transmitted to the client with no change from the server at all. In a typical PHP/MySQL site everything generated on the server site is considered dynamic, while every component that&#8217;s given to the client with no change is static. That&#8217;s why they don&#8217;t need cookies in the request.</p>
<p>That&#8217;s what Yahoo! <a title="YSlow" href="http://developer.yahoo.com/yslow/" target="_blank">YSlow</a> says:</p>
<p><a href="/wp-content/uploads/2010/03/Picture-14.png"><img class="aligncenter size-full wp-image-1280" title="Use Cookie Free Domains" src="/wp-content/uploads/2010/03/Picture-14.png" alt="" width="430" height="28" srcset="/wp-content/uploads/2010/03/Picture-14.png 430w, /wp-content/uploads/2010/03/Picture-14-300x19.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></a></p>
<p>In a short example, lets say you&#8217;ve a web page with 10 background images used by its CSS file. Here&#8217;s a good practice to combine them in one or even use base64 for them, but that&#8217;s another talk. So in that scenario you&#8217;ll send all the cookies you&#8217;ve on the site with this images, but actually they don&#8217;t profit at all from this. The question is why you should send all this data with no need? Won&#8217;t you benefit from sending it with no cookies.</p>
<p><a href="/wp-content/uploads/2010/03/Picture-13.png"><img class="aligncenter size-full wp-image-1281" title="Cookie Free Domains" src="/wp-content/uploads/2010/03/Picture-13.png" alt="" width="430" height="172" srcset="/wp-content/uploads/2010/03/Picture-13.png 430w, /wp-content/uploads/2010/03/Picture-13-300x120.png 300w" sizes="(max-width: 430px) 100vw, 430px" /></a></p>
<p>As it sound logical I read some articles recently describing that the benefit from putting the static content on a non-cookie domain doesn&#8217;t pays back. OK it may be strange, however every 40 ms or whatever of page load is important, aren&#8217;t they?</p>
<h2>Setup a Cookie Free Domain</h2>
<p>The problem is that if you&#8217;d like to setup a cookie free domain the things are becoming a bit harder. You&#8217;ve two options:</p>
<ol>
<li>Move all your static content on a different domain, where no cookies are set.</li>
<li>Move your static content on a different sub domain and set all the cookies to the www subdomain. (Here&#8217;s a bit tricky).</li>
</ol>
<p>All this indeed a bit tricky! So let me proceed with the next topic.</p>
<h2>Benefits from CDN</h2>
<p>A CDN or <a title="Content Delivery Network" href="http://en.wikipedia.org/wiki/Content_delivery_network" target="_blank">Content Delivery Network</a> is a term become famous with the growing web. Now big sites have servers in almost every continent and perhaps country. CDN is an abstraction of all this. The good thing is that there&#8217;s supposed to be stored static content. Think about the YouTube&#8217;s video files. Another good thing is that this domains are cookie free by default. The thing is &#8230;</p>
<h2>Why don&#8217;t You Combine Them?</h2>
<p>You&#8217;ll benefit from both ideas. Cookie free domains with CDN. In one side the web page will benefit from the closest location of the server and the CDN and in other side all this will come with no cookies to you. That&#8217;s really nice and most of the time people thing of CDN for only storing large scale data, such as video files, but no one says you cannot put your CSS, JavaScripts and background images there!</p>
<div class='yarpp-related-rss'>
<p>Related posts:<ol>
<li><a href="/2009/04/15/read-the-anchor-part-of-the-url-with-php/" rel="bookmark" title="Read The Anchor Part of The URL &#8230; with PHP">Read The Anchor Part of The URL &#8230; with PHP </a></li>
<li><a href="/2010/11/03/how-to-overcome-zend_cache_frontend_pages-problem-with-cookies/" rel="bookmark" title="How to Overcome Zend_Cache_Frontend_Page&#8217;s Problem with Cookies">How to Overcome Zend_Cache_Frontend_Page&#8217;s Problem with Cookies </a></li>
<li><a href="/2011/04/05/jquery-unbind/" rel="bookmark" title="jQuery.unbind()">jQuery.unbind() </a></li>
<li><a href="/2010/03/23/read-remote-file-content-type-with-zend_http_client/" rel="bookmark" title="Read Remote File Content-Type with Zend_Http_Client">Read Remote File Content-Type with Zend_Http_Client </a></li>
</ol></p>
</div>
]]></content:encoded>
			<wfw:commentRss>/2010/03/12/use-cookie-free-domain-and-cdn-for-static-content/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
	</channel>
</rss>
