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

  • SEARCH
  • Home
  • 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 6745503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:12:47+00:00 2026-05-26T12:12:47+00:00

is it possible to use javascript to reload a particular image that is has

  • 0

is it possible to use javascript to reload a particular image that is has cached?

On my site users can upload new avatars. After this is done, I want the browser to redownload the new avatar, so the user can see that the change is made.

At the moment, I’m doing it like this:

$('profilePic').src = 'flash/userImage.ashx?id=12345677&type=avatar&t=' + new Date().getTime()

userImage.ashx returns images based on id and queried type. It doesn’t use the ‘t’ parameter – this is just so the url is different, so the image reloads.

This works fine on the page where the user uploads their new avatar, but elsewhere on the site it will still use the cached image.

I could turn off caching for user avatars, but I don’t really want to do this. Is it possible to force a particular cached image to reload?

  • 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-05-26T12:12:47+00:00Added an answer on May 26, 2026 at 12:12 pm

    Maybe caching with ETag is a solution:
    http://en.wikipedia.org/wiki/HTTP_ETag

    When a different users loads a page after the avatar update, the ETag he sends with the request for the image is different than the ETag generated on the server and should therefore result in a 200 response instead of a 304, so the image is reloaded.

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

Sidebar

Related Questions

Is it possible to use javascript to control which frame of a GIF image
Is it possible to use javascript:location.reload(true) as a action= for a form without having
Is it possible to use JavaScript to detect whether a .swf file has loaded
Is it possible to use javascript to disable any code that would take the
Is it possible to use javascript to add target=_blank to all links that include
I was wondering if its possible to use Javascript to change the function/method that
Is it possible to use JavaScript to open an HTML select to show its
Possible Duplicate: Escape string for use in Javascript regex I have a msg like
I just wonder if it is possible to only use CSS but not javascript
Is it possible to get the value from a JavaScript variable and use this

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.