<?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>Think Lamp &#187; cache</title>
	<atom:link href="http://www.think-lamp.com/tag/cache/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.think-lamp.com</link>
	<description>Everything Linux Apache Php Mysql</description>
	<lastBuildDate>Fri, 18 Feb 2011 01:28:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.1</generator>
		<item>
		<title>Image with same path doesn&#8217;t show up due to cache in browsers</title>
		<link>http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/</link>
		<comments>http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 15:50:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[browsers]]></category>
		<category><![CDATA[cache]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://www.think-lamp.com/?p=191</guid>
		<description><![CDATA[Browsers are designed to think that Images with same name don&#8217;t change rapidly so regularly.  This creates a problem in some cases where you have to reuse a  specific name Or a specific location for a system. One such case can be a social network which is designed in a way where the profile images <a href='http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>Browsers are designed to think that Images with same name don&#8217;t change rapidly so regularly.  This creates a problem in some cases where you have to reuse a  specific name Or a specific location for a system.<br />
<span id="more-191"></span><br />
One such case can be a social network which is designed in a way where the profile images are always:</p>
<p><strong>http://www.mysite.com/users/images/user123/profile.jpg</strong></p>
<p>Now, on changing this image, sometimes browsers don&#8217;t clear cache and thus show the last image. In Order to solve this, use a random number at the end of the image location and you will be able to see that image. as browsers will not cache it.</p>
<p><strong>http://www.mysite.com/users/images/user123/profile.jpg?123</strong></p>
<p>One method that I used is:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$stamp</span> <span style="color: #339933;">=</span> <span style="color: #990000;">time</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imageLocation</span>  <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.mysite.com/users/images/user123/profile.jpg?'</span><span style="color: #339933;">.</span><span style="color: #000088;">$stamp</span>
<span style="color: #b1b100;">echo</span> <span style="color: #000088;">$imageLocation</span></pre></div></div>

<p>This should work.</p>
<a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save?linkurl=http%3A%2F%2Fwww.think-lamp.com%2F2009%2F09%2Fimage-with-same-path-doesnt-show-up-due-to-cache-in-browsers%2F&amp;linkname=Image%20with%20same%20path%20doesn%26%238217%3Bt%20show%20up%20due%20to%20cache%20in%20browsers"><img src="http://www.think-lamp.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a>]]></content:encoded>
			<wfw:commentRss>http://www.think-lamp.com/2009/09/image-with-same-path-doesnt-show-up-due-to-cache-in-browsers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

