UK Webmaster Talk - Online Marketing - SEO


 

Image cache live time

This is a discussion on Image cache live time within the Php and MySQL forums, part of the Programming / Scripting / Coding category; Is there any way to specify the length of time that images/info should be cached? Or a way to force ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Website Design & Development > Programming / Scripting / Coding > Php and MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 25-10-2005, 06:31   #1 (permalink)
Senior Member
 
Join Date: Jun 2005
Posts: 389
iTrader: 0 / 0%
FrozenDice will become famous soon enough
Default Image cache live time

Is there any way to specify the length of time that images/info should be cached? Or a way to force users to redownload images they think they already have but are in reality actually generated automaticly by php? Or would my best choice just to constantly change the filename when it's generated.
FrozenDice is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 26-10-2005, 19:30   #2 (permalink)
Cool Newbie
 
Join Date: Oct 2005
Location: oxford
Posts: 43
iTrader: 0 / 0%
talby101 is an unknown quantity at this point
Default

try this :
<img src="mypic.jpg?i=<?print md5(uniqid());?>">

That should prevent it from being cached.
talby101 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 27-10-2005, 21:10   #3 (permalink)
Senior Member
 
Join Date: Jun 2005
Posts: 389
iTrader: 0 / 0%
FrozenDice will become famous soon enough
Default

I hadn't thought of that talby thanks. Although I'm not looking to prevent caching alltogether, only when I update my site since it's been open and had visitors while it was still in development. I found just changing the name in the PHP and the filename worked.

Lock thread plz.
FrozenDice is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 28-10-2005, 08:26   #4 (permalink)
Cool Newbie
 
Join Date: Oct 2005
Location: oxford
Posts: 43
iTrader: 0 / 0%
talby101 is an unknown quantity at this point
Default

Sure, generally imaging caching is a good thing as it reduces your bandwidth and makes pages load quicker. If your site is now live you should find that caching should sort itself out if the image name or size has changed. Sometimes IE ignores this and you just need to hold the CTRL key while pressing F5 (forces IE to get a refresh from the server) to get your new image displayed.
talby101 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
cache, image, live, time

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
google cache question d6rth7ader Google Forum 7 16-08-2008 08:29
Live 8 Lewis General Webmaster Discussion 10 07-07-2005 16:11
See me live: has been set up. robertall General Webmaster Discussion 4 06-05-2005 19:09
Xbox live Bmg General Webmaster Discussion 12 15-04-2005 00:01
Real Live Html Training richy2 Ads, Offers & Services 0 02-03-2005 15:16


All times are GMT +1. The time now is 19:39.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41