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

Similar Messages

  • Thereis no sound on my macbook air. I have checked the volume and mute controls and the internal speaker are selected.  any one any ideas please.

    there is no sound on my macbook air. I have checked the volume and mute controls and the internal speaker are selected.  any one any ideas please.

    Hopefully one of these steps should solve the problem.
    1. Remove the headphone.
        If you see red light in the headphone port, plug the headphone
        in and out of the port 5 or 6 times to flip the microswitch inside.
        Sound output may be stuck in the digital mode.
    2. Reset PRAM.  http://support.apple.com/kb/PH4405
    3. Reset SMC.     http://support.apple.com/kb/HT3964
        Choose the method for:
        "Resetting SMC on portables with a battery you should not remove on your own".
    4. Applications > Utilities > Audio MIDI Setup
        Audio Devices window
        Side Bar
        Click the Built-in Output.
        Under Mute any of the boxes checked? If so, uncheck it.
    Best.

  • My Apple TV controller stopped working with my tv box. I changed battery. But the remote controller works in the store and it controles my iMac . What is the problem?

    My Apple TV controller stopped working with my tv box. I changed battery. But the remote controller works in the store and it controles my iMac . What is the problem?

    Hi Ron.
    Your Apple TV may have become paired with another remote. Hold the remote close to and pointed at the Apple TV, hold down the menu and Rewind buttons together for 6 seconds or until you see a broken chain icon on screen.

  • Projects are nt populating in the provider and receiver controls Lov

    Hi ,
    I created intercompany projects and while updating the provider and receiver controls , project are not populating there , i checked the all the necessary details and they are fine with me , any help on this .
    Regards

    Hi
    Check the setups once again
    Provider and receiver controls, Intercompany setup at IMplementation options
    Projects (intercompany) both provider and receiver
    Thanks
    Krishna

  • Premiere Pro CC and Encore CC are ignoring the Target and Maximum Bitrates

    Adobe Premiere Pro CC and Adobe Encore CC are ignoring the Target and Maximum Bitrates settings in the export window, The files that are exported are much smaller than what the estimated size of the file should be shown in the export window and are highly compressed. What can cause such an issue?
    I haven't drastically changed my presets.

    There is a very definite bug in the Adobe Media Encoder engine which is used in both Premiere Pro and After Effects.  H.264 exports seem to randomly choose their own export quality, using 2-pass VBR.  I have found with some DV-size exports on 'match quality' in Premiere Pro, that setting the export above 10Mbps pushes the quality down to well under 1Mbps, e.g. 167kbps.  I've found that using the default min 6, max 8 seems to work the best.  I've worked with this on two different machines and fiddled with it extensively and this is definitely NOT an intended 'feature'.  In fact, I have found that exporting from the same sequence, if I select the first 20 seconds, I get very low bitrate, but if I select 30 seconds or more, I get the higher bitrate that I want!  And I tend to get different results when I enable and disable 'use previews'.
    I am also having some trouble with missing frames when exporting progressive animation files to h.264 mp4 files that never occured before.  Not sure yet if this is related to the same issue, but interestingly, I don't get the 'blinking' missing frames issue when the bitrate drops itself down to a very low 150-200kbps.  When I do get the export rate up higher, then the missing frames on just this animation clip return.
    So, after my tests, here is a screen capture of sample export settings (yes, 15Mbps is a very high bitrate for DV, but the same happens at 6Mbps or 7 or whatever I try in some cases):
    This gave me a 1.5MB file with a reported 167kbps bitrate and a quality level as shown below:
    A currently working 'workaround' is to use 1-pass VBR which gives me a crisp, clean 5.5MB file.  Would a few others please try to reproduce this so we can get it escalated to bug status?  I'll report it if you can confirm it there, this is happening on two computers here.
    Thanks,
    Sean

  • Where are the Brightness and Levels controls?

    It's so simple, but it's late at night (early hours of the morning actually) and I'm stuck!
    The most basic of controls . . . . Brightness, Contrast, Levels etc. I just cannot find.
    Where are they?
    Anyway, I'm off to bed.

    Looking back to the old FCP, the Brightness filter was pretty appalling as it really upset the contrast etc. and it required complex fiddling with the other controls to get a semblance of balance back.
    Then a year or so ago someone made a new free Brightness plugin that not only adjusted the brightness but  automatically compensated the contrast controls so everything looked great.
    I can't remember the name of the creator or the plugin.
    It might be Luca and this, but I can't be sure.
    http://www.videonline.co.uk/Lucas_Image_Adjust.htm
    It's a pity that FCP X hasn't got a similar effect.
    The following adjustment gave the images a nice lift and kept everything pleasant to view.
    Highs   +10%, Mids  +5% and Shadows  +3%
    Message was edited by: Ian R. Brown

  • HT1918 I have changed my billing information and updated credit card info as it had expired but using same credit card only had to update the expiration and it still says its not the same that is on the account and i updated the account , still cant buy a

    I have tried to update my billing and account information which I was able to but in the billing section it keeps saying that the info doesnt match the bank info and the only thing was that the credit card had expired and I am still using the same one but cant buy a song, keeps saying its not correct.

    Ok, so I finally got help on this issue.  Basically, I had tried to edit my credit card information, and it secretly locked my account.  After finally getting a hold of a representative through the chat service on the support site, I was able to get this fixed.  I had been previously helped by someone through e-mail, but that was a complete waste of time.  Go for the chat service, it's a million times better.  They were able to release the secret block on my account...from trying to change my own information so that I could change it and be on my way.  Anyway, I hope this helps.

  • After adding list view into the web part page, the items and list control ribbon is not activated.

    I created new webpart page and added one list view web part into the page.
    However I can see the ITEMS and LIST tabs on ribbon area, but all the buttons are deactivated.
    Do I have to activate any feature for this or any settings are needed for the webpart?
    I already have full permission for this site.
    For your easy understand I added the screenshot.

    Thanks for you advice.
    However I am currently using the context menu and edit link in the view.
    My Client keep complaining about the ribbon is not activated even thought it works fine in the SharePoint 2010.

  • I want to disable the headers and footers. There's directions on ebay saying to go to firefox FILE and find PAGE SETTINGS to disable. I can't find these.

    I need to print my ebay flyer and in order for it to print correctly, I need to take the headers and footers off the page. How can I do this on firefox? I don't see a FILE or PAGE SETTINGS anywhere. Anybody out there?

    What OS are you on?
    In Windows: press Alt+F (opens classic File menu) > Page Setup
    (I don't have personal experience with Mac or Linux)

  • Want to use parental controls to prevent myself from being able to be on certain websites, but i can't do so on my account because i'm the administrator and parental controls don't work with the administrator. How can i do this?

    go on certain websites, but i can't use parental controls on my account because i'm the administrator. How do i prevent access to websites?

    Thanks for the reply, BUT --- i can't fool myself. I can make all the other accounts i want, but i'll still be able to get into the admin account and therefore have access to the websites i don't want to have access to. Is there a way to block websites from ALL accounts?

  • Ignoring the dot and Minus Symbol

    Hello ABAPpers,
    I have a field WRBTR(Amount in document currency) whose value contains the dot as well as minus symbol.
    I have to ignore this value.
    Is their any function module or the standard method to ignore this value.
    Please reply.
    Regards,
    Rahul

    hi,
    just declare another integer variable and use this code...
    data w_temp type i.
    if WRBTR < 0.
    w_temp = 0 - WRBTR.
    else.
    w_temp = WRBTR.
    endif.
    write w_temp.  " this will ignore - as well as dot.
    Regards,
    Siddarth

  • Windows 7 "Dim the display" and brightness controls missing

    Is this another driver problem? I would think the Nvidia drivers would support this new feature in Windows 7.
    http://www.technospot.net/blogs/windows-7-automatically-dim-display-screen/

    I suspect you need another driver (not the video card driver) since these function require control of the backlight. It seems Apple does not provide a standard driver that can be used by Windows as the display brightness can only be controlled through Apple's bootcamp drivers in the bootcamp control panel or using the keyboard shortcuts.
    Even in Vista, if you go to the Windows mobility centre (Win+X)there should be a panel for display brightness. This panel is missing in bootcamp, suggesting the necessary drivers are missing. This is a shame, but I wouldn't hold my breath for Apple to ever provide these. Then again, I didn't think Apple would ever fix the touchpad drivers for Windows, but they seem to have finally done so in the Bootcamp 3.0 beta drivers, so maybe someday...
    Windows 7 also supports automatic brightness changes based on an ambient light sensor, but again, no appropriate driver supplied by Apple...

  • The Watch and Gun Control

    Just read that Eric Holder is looking for some sort of electronic device to let only the owner of a gun is able to use it. Could the new Watch and/or the iPhone be used to send a signal to the gun only if the owner is wearing the Watch? Kind of an electronic lockout system.

    As the Apple Watch hasn't even been released yet, it's not possible to assess it's complete potential. Also, based on what you wrote, this Eric Holder person is still developing their product.
    You can certainly submit feedback to Apple here:
    http://www.apple.com/feedback

  • I'm mixing tracks together and can't work out where the volume and BPM control for each Track is located

    Which Table would be the best for mixing tracks together? I've been off the game for a bit and have forgotten, but last time i made a good mix tape from the New project table....
    Where do i go to match up the BPM for each track i lay to match up?
    How do i get the Volume line to pop up on each track so i can fade accordingly?
    Thank you to those who can help out

    The correct way to target instances m1 thru m10 using bracket notation would be... 
    this["m"+i]
    or even more correctly...
    this["m"+String(i)]

  • My mom forgot the restrictions and parental controls passwords on my iPod touch. Is there a way we can figure it out or something like that?

    I really need help please help

    - If you are up to file manipulation see:
    How to reset forgotten Restrictions...: Apple Support Communities

Maybe you are looking for