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 6229295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T09:32:31+00:00 2026-05-24T09:32:31+00:00

Basically, I have a page where users can upload their profile picture. However, if

  • 0

Basically, I have a page where users can upload their profile picture. However, if they are replacing their current one, after the new one overwrites the old one, the old one still appears after the page reloads because presumably because the old one is cached.

In PHP, I have tried using:

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

But it is not working in (at least) Google Chrome.

Any ideas what I can do so that when I reload the page after the pic upload, it forces the browser to always pull the file from the server so it pulls the latest one?

Thanks!

  • 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-24T09:32:32+00:00Added an answer on May 24, 2026 at 9:32 am

    As long as you’re concerned about controlling the cache with HTTP headers, you must look if the client is using HTTP 1.1 or HTTP 1.0 as well as if there are proxies in between or not.

    To generally specify that a resource should not be cached, you can consider the following headers:

    header("Pragma: no-cache"); # HTTP 1.0
    header("Cache-Control: no-cache"); # HTTP 1.1
    header("Expires: Thu, 01 Dec 1994 16:00:00 GMT");
     # With the two above, the last is not strictly necessary. Prefer a HTTP date in 
     # the past instead of -1 -OR- prefer 0 as it is specified how to deal with it.
    

    For what can be cached and how, see Section 13.4 Response Cacheability and for the specific headers, please see Hypertext Transfer Protocol — HTTP/1.1 Section 14 Header Field Definitions.

    Setting the correct headers does not mean you’re actually controlling the browsers cache in full. The only one who can do this is the user running the client. Any client can be configured to ignore these headers and just cache right away. E.g. pre-fetched content, whatever.

    The only thing you can do then is to change the URI of resource (the profile picture in your case). E.g. each time the user changes her profile picture you can count up a revision counter and append it to the URI. That done will ensure that when the revisioned location of the profile picture is requested by the browser, the correct image will be displayed.

    In case an old revision is requested, you must redirect to the latest revision. Redirect responses are most often not cached.

    Using revisions will help that user-agents are still caching the pictures (which is nice for your bandwidth and the pages performance) while they always will display the latest revision.

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

Sidebar

Related Questions

I have a page which basically allows an admin user to create manager user
I basically have a page which shows a processing screen which has been flushed
Basically I have a single page on my site that I want any php
I have a page that will basically be used to concatenate a bunch of
Basically, I have an iframe embedded in a page and the iframe has some
Basically, I have this webpage that is the header on any page you go
on my website I have an Enroll page where users submit some basic information,
I have made a personality test users can fill in. (Its in dutch, find
I have Web page in share-point 2010 ,its has two web parts one for
We have a hosted application that manages pages of content. Each page can have

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.