Prolem with Cache-Control:max-age http header

Hello
It seems that safari do not take into account Cache-Control:max-age=31536000 http header.
Sending this header to the browser I would expect that safari will not ask the server for these resources before current date + one year.
It's the way IE and FireFox are working but safari is asking the server for these resources every time my html page is loaded (see http requests below).
Server returns a 304 status to indicate that the resource is not modified.
Does somebody have an idea about this strange behaviour?
I'm surprise that Safari do not respect RFC specifications.
Is there a settings to enable Cache-Control ?
Perhaps I forgot safari's specific headers..
Thanks
+GET 786+
GET /xtend/htmrsrc/LIB/XtendAjaxScripts.js HTTP/1.1
+RESP 786+
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Last-Modified: Wed, 15 Oct 2008 13:25:24 GMT
*Cache-Control: PUBLIC, max-age=31536000, must-revalidate*
*Expires: Thu, 05 Nov 2009 13:09:10 GMT*
Content-Type: application/x-javascript;utf-8
Content-Length: 2856
Date: Wed, 05 Nov 2008 13:09:10 GMT
+GET 799+
GET /xtend/htmrsrc/LIB/XtendAjax.js HTTP/1.1
If-Modified-Since: Fri, 24 Oct 2008 07:59:24 GMT
+RESP 799+
HTTP/1.1 304 Not modifed
Server: Apache-Coyote/1.1
Date: Wed, 05 Nov 2008 13:11:19 GMT

This is a User to User forum, not a developer forum. You need to avail yourself of developer resources for this problem instead of posting them here.
Mulder

Similar Messages

  • JSWPS does not recognize max-age?

    Hi Experts,
    It seems SJWPS only works with HTTP Last-Modified but not Cache-Control max-age header. I've tested with HTML pages with
    Cache-Control: max-age=300, s-maxage=300
    but none of them gets cached.
    Can any one confirm or clarify?
    Thanks,
    Brian

    Someone mentioned that if FF gets a querystring it always goes for a unconditional request (even if the querystring was already requested earlier)
    http://webmasters.stackexchange.com/questions/16011/why-doesnt-firefox-cache-my-images-and-css

  • Can't propagate Cache-Control headers with Surrogate-Control header

    My application may set the following response header to cause webcache to process the esi:include's:
    Surrogate-Control: content=ORAESI/9.0.4, max-age=3600
    It and also may set the following intended for the browser cache:
    Cache-Control: private
    or say:
    Cache-Control: max-age=3600
    However Webcache removes this and always adds the following whenever surrogate-control has been set:
    Cache-Control: max-age=0
    This means I can't have browser caching and esi page compilation, just one or the other.
    This seems to be designed behaviour can someone explain why this is and if it can be worked around?
    I realise that the Cache-Control header should be ignored by webcache but why cant I propagate it to higher caches?

    Patrik,
    You'll need to convert the meta http-equiv tags into actual HTTP headers before sending for Web Cache to be able to parse it.

  • JRE Cache ignores the "Expire" and "Cache-Control: no-cache" directives.

    My applet is using HttpURLConection to retrieve data from a server with Caching enabled. The cache contents are "revalidated" (via "if-modfied-since") each time the applet is started. However, subsequent requests to retrieve the same resource are always read from the cache with no validation even if the resource has expired.
    The server is sending a valid "Expires:" tag and "Cache-Control: no-cache" tag in the response; but, the JRE refuses to recheck for an updated version of the resource even after the file has expired.
    The JRE does seem to understand the "Cache-Control: no-store" tag; but, this is inefficient (no caching at all) when I'm tring to get it to not refetch the resource unless there's a change. Is there some other tag that the JRE is expecting to see?

    I have a similar problem except that I want my pages to not cache at all. The server is setting the Cache-Control: max-age to 0 and the Expires to "now" but JRE seems to ignore these settings, but only sometimes. Sometimes pages are fetched from cache and sometimes from the server.
    In my applet I'm using a normal URLConnection like this:
    URLConnection uc = new URL("http://<server>/method").openConnection();
    uc.connect();
    InputStream is = uc.getInputStream();
    is.read();When my request headers look like this:
    accept-encoding: gzip
    Host: <server>
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_13
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-alivethe page will not be cached and is requested again but this time without the accept-encoding, Pragma and Cache-Control. The adding (and removal) of the headers seems to happen inside the JRE, though. I'm not explicitly setting them.
    The response header of the first request looks like this:
    HTTP/1.1 200 OK
    Date: Wed, 20 May 2009 12:55:07 GMT
    Server: Apache/2.2.11 (Win32) mod_jk/1.2.26 PHP/5.2.8
    Cache-Control: max-age=0
    Expires: Wed, 20 May 2009 12:55:07 GMT
    Vary: User-Agent,Accept-Encoding
    Content-Encoding: gzip
    Keep-Alive: timeout=120, max=79
    Connection: Keep-Alive
    Transfer-Encoding: chunked
    Content-Type: text/html;charset=iso-8859-1When the request is made with this header:
    User-Agent: Mozilla/4.0 (Windows XP 5.1) Java/1.6.0_13
    Host: <server>
    Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    Connection: keep-aliveThe response headers looks like this:
    HTTP/1.1 200 OK
    Date: Wed, 20 May 2009 12:55:07 GMT
    Server: Apache/2.2.11 (Win32) mod_jk/1.2.26 PHP/5.2.8
    Content-Length: 1016
    Cache-Control: max-age=0
    Expires: Wed, 20 May 2009 12:55:07 GMT
    Vary: User-Agent,Accept-Encoding
    Keep-Alive: timeout=120, max=83
    Connection: Keep-Alive
    Content-Type: text/html;charset=iso-8859-1And in this case the JRE sometimes fetches the request from the server and sometimes from cache. I have not been able to determine how the JRE decides to refresh, or why it sometimes sends an accept-encoding and Pragma header and sometimes not.
    any help would be appreciated.
    Alex

  • Weblogic setting Cache-control: no-cache?

    I have a servlet filter that sets the Cache-control http header to "max-age=30" for static files such as *.css but in the end weblogic sends the value "no-cache".
    When the browser asks for the same static file again weblogic responds with http 304 and Cache-control "max-age=0" thus overriding my filter again.
    Is there any way to change the client side caching in weblogic (10.3.4)?
    (btw the servlet filter works in tomcat)

    Hi,
    1. response.setHeader("Cache-Control","no-cache");
    This is used to prevent the browser from caching your dynamic content generated by a JSP or Servlet.
    You set this attribute in the HTTP header of the response object which would tell the browser not to cache this content. So everytime you request the page again, the browser would make a new request, instead of showing you a cached page.
    2. response.setHeader("Location", "error.html");
    This is called redirecting. "Redirecting" is sending a response from your servlet to the browser telling the browser to go to a new location(make a new request)
    The standard way to do this response.sendRedirect(String);

  • Reload previous page on back button - using cache control

    Hi,
    In my application I am using cache control to avoid the pages to be cached. But the requirement is changed and now the previous page can be re-loaded on hittinh browser's back button even after the 10 mins. i.e if user hits the back button with in 10 mins he should be allowed to see the pre-loaded contents on the previous page. After 10 mins the browser should display the page refresh warning.
    a) Old code to preventing caching:
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0     
    response.setDateHeader ("Expires", -1); //prevents caching at the proxy server
    b) I am trying with the code ha changes as to get the previous page with in 10 minutes time:
    response.setHeader("Cache-Control","no-cache, max-age=600"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0     
    The above code changes are not working. If uses "no-cache" with max-arg=600 it behaves like the code in section a).
    If I uses response.setHeader("Cache-Control","max-age=600"); then even after 30 mins it load the previous page with preloaded contents.
    Any help is appreciated.

    I tried it lots of time by refreshing the browser's cache. I am using IE 6.0. I tested it through FireFox to get the header details. when I submit the request it displays the headers request
    same as I set in the code. But when I hit the back button (after the max age time passed) still it gets the value from cache and no header values are displayed.

  • Cache-Control problem

    I don't really know if this is a Tomcat problem or a jsp problem... I have some java server pages with form components and when I hit the back button in a browser, the contents of a form disappear. I checked the response header with a perl script and it seems that there's always Cache-Control: no-cache and Pragma: No-cache in the header. I didn't put them there. I've tried to put some lines as
    response.setHeader("Cache-Control","max-age=3600");
    response.setHeader("Pragma","max-age=3600");
    response.addHeader("Cache-Control","max-age=3600");
    response.addHeader("Pragma","max-age=3600");
    into my jsp, but they have no effect. I've tried disabling all filters, no effect. I've done a full text search on the whole tomcat directory tree with keywords like no-cache, cache-control and those words don't appear anywhere (but in my jsp). I suspected that apache could mess things up, but browsing the jsp's directly from tomcat (through port 8080) does the same.
    Running out of ideas... Do you have any?
    -Marko

    It's neither. It's a browser problem... and perhaps your assumption that the browser has to remember what was in the form fields when you go back. Cache control has to do with caching the page, not form input anyway. I've never seen any header settings which tell instruct a browser what to do with form data after the form is submitted.
    You could provide a back button on the form and have the JSP fill in the default values based on what's stored in the session, if you are storing it in the session. But if it's not a multipage form, there usually is no reason to be "going back" anyway, because the form is submitted and whatever's done with that data should be done by that point.
    Tomcat could be defining default headers for anything in some config file.

  • Cache-control on IPlanet 6.0 SP5 doesn't work

    Hi.
    I am desperately trying to set cache-control max-age=0/no-cache to every file that is sent by the IPlanet from a special directory. I used the web console to set /dir/* to no-cache or max-age=0 but althoug the settings are applied and the server is restarted the HTTP header is still not touched in any way.
    I read to changes of SP6 and SP7 but couldn't find anything regarding this problem so I haven't upgraded yet.
    obj.conf says:
    <Object ppath="/var/apps/weblogic/myserver/public_html/mydir/*">
    PathCheck fn="set-cache-control" control="no-cache"
    </Object>
    This is placed directly after the default object.
    Any help is highly appreciated. Thanks a lot,
    Thomas

    There's a big difference between the set-cache-control SAF and the HttpServletResponse.addHeader API. set-cache-control understands the HTTP protocol version in use and, if that version supports Cache-control header fields, adds a Cache-control header. HttpServletResponse.addResponse blindly adds any header you specify.
    If you want to use HttpServletResponse.addHeader to add a Cache-control header to a response in Web Server, you can do so. The meaning of that header isn't defined by the HTTP/1.0 protocol, however.

  • Wiki cache-control

    I'm becoming confused by the settings for caching wiki pages and their elements.
    Using the develop menu and Network Timeline window in safari I can follow the downloading of images, css, js files etc.
    I recognise that the wiki page itself is set not to cache for obvious reasons of maintaining up-to-date copies of a page, but the other elements seem to sometimes be cached by my browser and at other times (i.e. currently) resolutely not cached.
    The network timeline (currently) says that all the others files have their cache-control set to max-age = 0. Hence it is not surprising that my browser repeatedly downloads the files.
    O.K. So the question is;
    What sets this value? Presumably the wiki server ( although possibly my browser), but on what basis, how and can it be changed?
    When I first started looking at this issue, a few weeks ago, I managed to arrive at a situation where almost all 'elements' were being successfully cached and page downloads were under 2 seconds. Currently It's up to over 6 seconds. I don't know if, or how, I've changed anything.
    Can anyone offer any guidance or direction as to where I can find out more about how these settings are achieved?
    Ta.

    I realise that it is the weekend but although this post has prompted a reasonable number of views no responses, so I will offer a little more information about the situation in the hope of eliciting some advice...
    I have edited the httpd_teams.config file to include the line
    Header set Cache-Control "max-age=600001, private, must-revalidate"
    and restarted Apache.
    I then clear the cache in Safari, quit and restart.
    On re-entering the URL of the wiki it loads a page in approximately 7 seconds. On inspecting the request and response header of one of the .css files, for example, the request makes no reference to cache-control but the response, correctly, contains the cache-control statement as set above.
    However, when I navigate to another locaction and then return to the page the .css request contains max-age=0, ( with the response still correctly set).
    WHY?
    Just to make matters 'worse', some other files, particularly .png files for some reason, correctly retain the set max-age and use the cache as I intended.
    Clearly, I am missing something. Does anyone have the slightest idea what or how to go about working it out?

  • Cache control directives for Weblogic 6.1

    Hello:
    I was wondering if anyone knew if one could configure Weblogic 6.1 to produce
    cache control headers (ie "Cache-control: max-age=1800")? I realize that I should
    probably be using a conventional HTTP server and the WLS plugin, but I'm just
    doing some research here. So any help would be appreciated.
    Thanks,
    Scott Resnik

    Can you show us your obj.conf file?
    Thanks
    Manish

  • How to set HTTP header field "cookie" with http receiver adapter?

    Hi,
    I am using http receiver adapter (not axis) in a scenario. I could not set a parameter with key cookie in http header. Is there some kind of restriction to set it? I am able to set others like connection and create custom fields using ASMA and dynamic key configuration via UDF on mapping.
    Could you please comment on, is cookie http parameter special or noneditable by PI's http adapter? I am looking for a solution without editing any abap code...
    Regards,

    I believe it is possible since axis adapter provides very same functionality. Let me summarize my scenario may be it helps:
    I am trying to call series of webservice lets say in a BPM. First service (login service) will provide me with a session id (in http header with key Set-Cookie) then I will call another service which has that session id in its http header with key cookie then I am going to logout. So I am testing the second part now, but it doest let me send cookie http header parameter.
    I hope I clarified a bit more my problem.
    Regards,

  • How do I set the Http Header POST URL in SAAJ?

    Hi ,
    I am a newbie in the field of web services. I was trying to create a SOAP request with Http Header POST information having a POST url like
    the following:
    POST /OMASTI.xml HTTP/1.1
    Content-Type: multipart/related; boundary="eladeladeladeladeladeladeladeladelad"; type=text/xml; start=11814460
    Content-Length: 54596
    Host: unspecified
    SOAPAction: ""
    to that effect I did the following in the SAAJ client:
    MimeHeaders md = message.getMimeHeaders();
              md.setHeader("SOAPAction" ,"\"\"");
              md.setHeader("POST" ,"/OMASTI.xml");
    However what I got was :
    POST / HTTP/1.1
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: ""
    POST: /OMASTI.xml
    Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_2_32124414.1153146262750"
    Content-Length: 3352
    Cache-Control: no-cache
    Pragma: no-cache
    User-Agent: Java/1.5.0_07
    Host: www.google.com
    Connection: keep-alive
    I have two POSTs in the header. How do I fix it? Please Help ASAP.
    Regards,
    Zeus

    Hi,
    Please forgive my ignorance. I did the same as you said. and then checked the Http request being sent out using ethreal software... it was the same as I had told earlier. Is only POST supported by the connection object? And the does the URL that comes in the Mime header as POST refer to the URL to which the request was sent? what I mean is that if the mime header says
    POST /OMASTI.xml HTTP 1.1, does it mean that the URL that was passed to the connection object was "/OMASTI.xml" ? I had given the url as http://www.google.com to test the request being sent.. I only have a sample SOAP request which shows a HTTP header with the post url as I said before. I need to create a SOAP request with the same sort of Http header and the body needs to follow a certain OMA-STI protocol. My experience in the SOAP domain is almost nil. So please enlighten me.
    Thanks in advance,
    zeus

  • Multiple Cache-Control Directives- iPlanet

    Hi,
    Quick question: I'm running iPlanet 4 and want to add 2 cache control directives to the same directory. I want to add a max-age of 1 and a must-revalidate directive. Is this possible? The behavior I was seeing is that only 1 directive was being sent along with the request/response to the client. The end result I want is that the client will check (almost) every request for a file and if it is new pull that file, if not allow the cache'd version to be used.
    Thanks in advance,
    Jason
    obj.conf:
    <Object ppath="/www/iplanet/site_docroots/plannet/p/*">
    PathCheck fn="set-cache-control" control="max-age=1"
    </Object>
    <Object ppath="/www/iplanet/site_docroots/plannet/p/*">
    PathCheck fn="set-cache-control" control="must-revalidate"
    </Object>

    PathCheck fn="set-cache-control" control="max-age=1,must-revalidate"

  • Firefox is caching my website page even http cache-control header was in use

    Hi
    Http header "Cache-Control: private, no-cache, no-store, must-revalidate" was used but firefox still caching my webpage. authenticated page of website can be viewed by using work offline feature of firefox.
    Please Help
    Thanks
    Prasant Sharma

    https://developer.mozilla.org/en-US/docs/HTTP_Caching_FAQ
    CORS was added to Firefox 29, IIRC. <br />
    https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS
    Have you looked into Page Info, specifically the Meta Tags? <br />https://support.mozilla.org/en-US/kb/page-info-window-view-technical-details-about-page

  • Surrogate-Control http header

    Access to files from the http viewer seems to include some Surrogate-Control directives in the http response header. These directives either give a max-age of 0 or specify no-store.
    Is this configurable for iFS and if so how can I avoid this. To be able to cache read-only documents would speed up access tremendously.

    You may be running into an SSO bug where SSO is inserting these "no-cache" headers. (iFS does not insert any extra headers on its own.) Try posting on the SSO message board or following up with Oracle support to get the latest patches for SSO.

Maybe you are looking for

  • How do I open raw files from my Canon 6D in Photoshop CS5.1?

    Just tried to open raw files from my Canon 6D in Photoshop CS5.1. An error message appeared: " Could not complete your request because the file appears to be from a camera model which is not supported by the installed version of Camera Raw. Please vi

  • Looking to create a scroll bar within a section of a webpage

    I think the best example of this is in the iTunes store i.e. you have a section of say, music, and you scroll left to right to see more. I'd appreciate any help with this, whether it be the proper coding techniques or pointing me in the right directi

  • Has anyone tried BIM360Glue on the iPad mini?

    Hi all - We're using BIM360Glue on iPad 3's at the moment with great success, but I'm wondering if anyone has used it on a Mini, and if so whether anyone has any feedback on it?

  • Problems activating signal express 2.0 in labview

    Hello, I have purchased a copy of LabVIEW Base Edition 8.2.1 and Signal Express 2.0.  I receive the following error when I create a LabVIEW VI containing a Signal Express VI (in this case a Signal Express Create Signal VI): NI_MAPro.lvib: This librar

  • ID setting for WebServices

    I want to know how to define web services in ID. - Is that a business system or business service? - What (settings for TS, BS) needs to be done in SLD. Thanks