Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7761023
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:02:45+00:00 2026-06-01T14:02:45+00:00

Whenever a user uploads a new image, and the image name remains the same

  • 0

Whenever a user uploads a new image, and the image name remains the same (since the image name is based on the file extension and userid value) chrome doesnt update the cache, and the image appears to stay the same.

for example, a user will upload the file image.png

the server will analyze the file and store it as

87.png

however, the previous file image2000.png was also stored as

87.png

even though they are different files.

Now, the img call is

<img src="/images/87.png">

for both separate images, but chrome doesnt realize they are changed, so it outputs the cached image 87.png instead of loading the new image in the server which was just updated.

is there a way to force chrome (and other browsers) to realize that this image was just updated, and to load the image from the server instead of the cache? or does the image need to have a new name for it to realize?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:02:46+00:00Added an answer on June 1, 2026 at 2:02 pm

    Sorry my bad, I didnot read the question properly.

    This behaviour is because of the expires header of the response from your server. After updating the image, set headers for that image to be expired. So the browser gets the updated image.

    header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); // Date in the past
    

    How to specifically set the headers to updatd image?

    put a column called updated in the database. So everytime you update an image set this column to 1.

    (if update ==1)
    

    set appropriate headers

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My extension adds a context menu whenever a user selects some text on the
I'm following the guide here: http://webtempest.com/how-to-allow-image-uploads-in-rails-on-heroku/ And I am getting an error whenever I
I have an image of a bottle, whenever user shakes the device i want
The situation is that the user enters a value in the textbox.Now whenever user
I have table with following structure Whenever user click on checkbook and click on
I have implemented mail composer. But it opens mail composer whenever user had implemented
Whenever the user scrolls map or zooms in/out, this method gets called instantaneously. I
I am trying to record whenever a user clicks on Facebook Like button. Facebook
I am developing an app whenever a user add some details the record get
Hi I have a spinner (spinner5) and whenever the user selects an item that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.