Skip navigation

here’s a great tip i found on php.net I found that I didn’t want to forget

You can use the Header command to force a browser to use fresh content (no caching).

However, this only works for the HTML code your code generates. When you have updated images for example (with the same filename) then there’s a chance that these are still cached.

The easiest way to solve this problem I found is changing:

<?
print "<img src='yourfile.jpg'>";
?>

into:

<?
print "<<mg src='yourfile.jpg?".time()."'>";
?>

This adds an unique number to the url and wont hurt at all.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: