How do I stop Safari from caching my Servlet response?

Posted by Cliff on Stack Overflow See other posts from Stack Overflow or by Cliff
Published on 2010-06-16T01:30:54Z Indexed on 2010/06/16 1:32 UTC
Read the original article Hit count: 286

Filed under:
|
|
|

I'm having trouble testing a web app with Safari. My app returns wave audio data. The problem happens when I change the application and hit it again from Safari. Safari caches the original response so no matter how many times I hit refresh it seems like I've not updated anything. I can almost get around this using force refresh with Firefox but because I'm having trouble generating the wave headers using the javax.sound API Firefox only plays the first second of audio returned. A few weeks ago I tried setting the HTTP header in my servlet to prevent caching but I don't think I was setting it correctly. (What is the header for browser cache control?) This is becoming a real pain and I'm looking for any ideas, comments, or alternative approaches. I'm getting ready to try again but I figured I'd ask here in the interim to see if someone can provide help.

© Stack Overflow or respective owner

Related posts about java

Related posts about http