SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Deleted Pictures sometimes display instead of the correct ones

    I'm working on developing a photography site. While it is under development and testing I am using unlink to delete previously uploaded pictures and truncating the table that that keeps a record of the pictures.

    When I load other images after doing the delete and truncate, images that were previously deleted still occasionally display instead of the newly uploaded image.
    They would share the same photo ID since ID's are reused after truncating the table that creates them. This might not be a problem once the site is completed since, it is unlikely a newly uploaded image would have the same ID as a previously deleted image. It is still an interesting, although annoying anomaly.

    If I do a refresh the correct image will then display. Is there a way to prevent this anomaly?
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com

  2. #2
    He's No Good To Me Dead silver trophybronze trophy stymiee's Avatar
    Join Date
    Feb 2003
    Location
    Slave I
    Posts
    23,424
    Mentioned
    2 Post(s)
    Tagged
    1 Thread(s)
    It's a caching issue. Don't reuse filenames for deleted files.

  3. #3
    SitePoint Addict dbr's Avatar
    Join Date
    Aug 2006
    Location
    Tucked away in the mountains...
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks!

    Quote Originally Posted by stymiee View Post
    It's a caching issue. Don't reuse filenames for deleted files.
    Okay. Thanks for the quick response. I have the file names auto-created but I'll add something that will make them always unique.
    "Three components make an entrepreneur:
    the person, the idea, and the resources to make it happen."
    Anita Roddick ~British entrepreneur
    dbr founder of: ProximityCast.com


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •