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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:29:28+00:00 2026-05-24T23:29:28+00:00

I’d like an HTTP response to expire 24 hours from now (meaning the browser

  • 0

I’d like an HTTP response to expire 24 hours from now (meaning the browser won’t make any requests for that URL until tomorrow). But, if the request is re-issued tomorrow after expiration, I want to make sure the browser will send the right request headers so that the server will send a 304 instead of forcing the client to re-download the whole response body if it hasn’t changed on the server. And I’d like that 304 to also expire 24 hours later.

First, is this sccenario possible? Or do I have to choose between Expiration-style caching and 304-style caching, but not both? If it is possible, what are the right response headers (both for the initial response and for the subsequent 304s) which will make it happen?

If as often happens, the answer varies based on browser type/version, then which headers work for which browsers– and which browsers won’t be able to do what I want at all? I’m only interested in the most common browsers in use today (e.g. IE6+, FF3+, Chrome latest, Safari latest)?

Apologies if this answer has already been asked on SO– I searched for a while and came up blank.

CLARIFICATION: I’m asking this question because I’m putting together an automated test suite to verify, regardless of server platform, that a web app is generating the correct HTTP headers to generate the client-caching behavior we want all our web apps to have. So I’m not interested (at least for now) in how to configure Apache/IIS/PHP/Rails/Django/JSP/ASP.NET/etc. to generate the right headers. I simply want to know, at the HTTP layer only, what the right headers are.

UPDATE: I found this SO question which answers part of my question. According to RFC 2616 10.3.5, it says, I should include an Expires: or Cache-Control: max-age headers to the 304s returned by the server. This is definitely the desired behavior.

What that question doesn’t answer, however, is whether this RFC-compliant approach will work on existing popular browsers, especially IE6/7/8 which are the usual standards-compliance culprits, but also IE9, FF4+, latest Chrome, and latest Safari which our application also must support. If any of those browsers don’t behave as the RFC mandates, are there workarounds I can use?

  • 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-24T23:29:29+00:00Added an answer on May 24, 2026 at 11:29 pm

    Send an ETAG header so that the client may make a conditional HTTP request to revalidate a response after its freshness lifetime has expired.

    Send a Cache-Control: max-age or Expires directive to specify when you want the resource to expire.

    Avoid using a Vary header or any directive that forbids caching.

    These directives will work in all popular browsers (IE6+, Firefox, Chrome) except for Safari on Windows, which alone lacks a persistent HTTP cache that works across multiple sessions.

    http://blogs.msdn.com/b/ie/archive/2010/07/14/caching-improvements-in-internet-explorer-9.aspx explains what happens when you fail to provide proper caching headers.

    Fiddler’s Caching response inspector will help you understand how a given response will be cached.

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

Sidebar

Related Questions

For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I would like to count the length of a string with PHP. The string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
this is what i have right now Drawing an RSS feed into the php,

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.