I have a problem (possibly) with cached (?) images - HELP!!

Discussion in 'HTML & Website Design' started by SteelRat, May 15, 2008.

  1. #1
    I have this really frustrating problem with my website - and it sort of appeared out of blue!

    It's a site where people can upload photos - and when they upload something, the picture gets renamed to a standardized name. If they then remove this picture and upload something else,the new picture would be assigned the same standardized name. Also, it creates a top list of the pictures every 15 minutes, and the best picture gets copied into bestpicture.jpg - the main page has a link to bestpicture.jpg

    This WORKED for a few months and now it stopped working last week.

    Suddenly the pictures don't get updated until you click refresh or press F5 key. - the filename is same but content in picture has changed. Apparently this became a problem for a lot of user from lot of different locations, computers, operating systems and browsers.

    I though that maybe there is something wrong with the HTML / PHP code and tried using things like this:

    <META HTTP-EQUIV="Expires" CONTENT="-1">
    Header("Cache-Control: must-revalidate");

    However this did not work. Then I discovered that this did not only apply when I uploaded pictures through the site - if I went directly to my web hosting control panel and did a manual upload / erase / upload new - same things happened!!!!!

    What happens is following:

    - I upload picture A into directory "npics" with for example name AP2.jpg (directly into directory through web site host control panel - not even through my website)
    - I look at that picture AP2.jpg by clicking view - it shows image of A
    - I then erase that picture
    - I then upload another picture B into "npics" with THE SAME NAME AP2.jpg
    - I look at that picture AP2.jpg by clicking "view" in the control panel - it shows picture A and not B!!
    - I press F5 to refresh and then AP2.jpg correctly shows image B

    This problem happend both with IE and netscape - and both at home and behind a different computer. At home, I did not need to refresh though, it got fixed when I closed IE / netscape.

    Totally frustrated here... as the problem appeared independent of the code on my website, and it just appeared last week - I contaced my web hosting company, but basically, while friendly, the answer was that they don't know.

    To me it appears they just changed some setting... welll maybe not.

    Is there anything I can do in my code to fix this????? This is really messing up the website... :( :(

    Hope someone can help.. thanks!!!
     
    SteelRat, May 15, 2008 IP
  2. JPF

    JPF Guest

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This could be your problem. Like you say it could be browser Caching. I suggest changing this so the new pictures get a new name all together. This will force the browsers to download the new version.
     
    JPF, May 16, 2008 IP
  3. SteelRat

    SteelRat Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Changing the file naming convention would require a major overhaul... parts of the filename are used for queries....

    I'd rather prefer a way of forcing the browser to get the latest image and ckip the cache, if the image on server has been updated....

    tried the usual approaches, PHP header and HTTP-EQUIV .... did not work at all...
     
    SteelRat, May 16, 2008 IP
  4. Ulquiorra

    Ulquiorra Peon

    Messages:
    422
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Changed anything last week?
     
    Ulquiorra, May 18, 2008 IP