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.