Current location: Hot Scripts Forums » Programming Languages » PHP » PhpThumb


PhpThumb

Reply
  #1 (permalink)  
Old 07-04-06, 05:41 AM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
PhpThumb

Does anyone know how to use phpThumb?

I have a problem with the cache. When I replace an image with the same name and settings, my browser or maybe phpThumb will load the cached image instead of the new one.

I need to know how to delete a particular cache so that whenever I delete an image, I will also delete it's cache. Seems like the cached image name is hashed. I have no idea how to regenerate the hash.

For example, if I make an image :-
phpThumb.php?src=uploads/0018.jpg&wl=128&hp=128
It will generate a cache :-
phpThumb_cache_localhost_src9a75e89a946fe8806c4d99 765ef5e75d_par8ef1fff75b634c96b07a379e91bdfd22_dat 1152005649.jpeg

So, when I delete the image, I want to delete it's cached image as well but how do I get the hashed parameter?
__________________
Mr. Brown Eyes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 07-04-06, 08:48 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
You could try sending headers to not cache the images.

PHP Code:

header("Cache-Control: no-cache, must-revalidate");

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 07-05-06, 09:44 PM
eddyvlad eddyvlad is offline
Wannabe Coder
 
Join Date: Sep 2003
Location: In The Bloody Pits Of Hell
Posts: 160
Thanks: 2
Thanked 0 Times in 0 Posts
Actually i already did. Because I did my site in Ajax, the page doesn't refresh. Therefore, the browser doesn't load the new image. How do I work around this?

Basically, the page will upload image, show it's progress, then display the image in a div tag. When you upload a new image, it will replace the one you uploaded previously but the new image won't load because it's showing the cached image.
__________________
Mr. Brown Eyes
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


All times are GMT -5. The time now is 11:26 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.