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

The Archive Base Latest Questions

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

I am trying to refresh a page, but WANT to use the cache and

  • 0

I am trying to refresh a page, but WANT to use the cache and can’t figure out how to do this. There are two situations:

  • If I click in the URL bar and hit enter (or visit the page from somewhere else) it reloads the page/images from the cache. GREAT!

  • If I click on the refresh button or use Javascript to refresh the page it grabs all the images again and takes forever. NOT GREAT!

I’ve tried: top.location.reload(false); and top.location.reload(true); (I’m sending this from in an iFrame) and neither used the cache. I’m avoiding using location so it doesn’t end up in the browser history twice.

Question: How do I reload the page using the cached images? Is there a different javascript function or is this a mod_expires issue?

Thanks for any help in advance!

EDIT: (info from chrome: developer tools)

  • When navigating to the page I get “From Cache” for all images
  • When refreshing page I get “304 – Not Modified” for all images (and it takes the time to download each)

EDIT 2: (Headers from an image, safari: developer tools)

Javascript: top.location.reload(false); (No Cache!)

Status Code:304 Not Modified

Request Headers
Cache-Control:max-age=0
If-Modified-Since:Tue, 28 Jun 2011 07:13:17 GMT
If-None-Match:"104684ae-a7d-66e41d40"
Referer:http://getdirectus.com/dev/media.php
User-Agent:Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_7; en-us) AppleWebKit/533.21.1 (KHTML, like Gecko) Version/5.0.5 Safari/533.21.1

Response Headers
Cache-Control:max-age=157680000
Connection:Keep-Alive
Date:Tue, 28 Jun 2011 16:56:50 GMT
Etag:"104684ae-a7d-66e41d40"
Expires:Sun, 26 Jun 2016 16:56:50 GMT
Keep-Alive:timeout=5, max=94
Server:Apache/2.0.54

Navigating to page: (Uses cache)

Status Code:200 OK

Response Headers**
Accept-Ranges:bytes
Cache-Control:max-age=157680000
Connection:Keep-Alive
Content-Length:2685
Content-Type:image/jpeg
Date:Tue, 28 Jun 2011 16:54:20 GMT
Etag:"104684ae-a7d-66e41d40"
Expires:Sun, 26 Jun 2016 16:54:20 GMT
Keep-Alive:timeout=5, max=99
Last-Modified:Tue, 28 Jun 2011 07:13:17 GMT
Server:Apache/2.0.54
  • 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-23T12:26:43+00:00Added an answer on May 23, 2026 at 12:26 pm

    The documentation for window.location.reload( false ); says it will load from cache. If that isn’t happening then you may be seeing a browser bug. See if you can replicate the problem in another browser.

    EDIT (for your edit): You are seeing that behaviour because you don’t have an Expires header set in the future. You will need to add an Expires header in Apache.

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

Sidebar

Related Questions

I'm trying to use timer to refresh an image from the internet. This is
I am trying to refresh the page with this statement in external javascript file
I'm trying to use jQuery to make a slightly more sophisticated page refresh. With
I'm trying to refresh a page without sending POST from the previous time. I've
I am trying to refresh the page after a cgi execution. In my cgi,
I m trying to refresh the screen on clicking a button so i want
Working on figuring out my NullPointerException within my custom simplecursoradapter when trying to refresh
I am trying to use periodic refresh(ajax)/polling on my site by XMLHttp(XHR) to check
I'm using a repeater on my page. I want to populate this repeater based
I am trying to implement paging across ajax calls. The page should not refresh

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.