0

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.

Cliff
  • 9,408
  • 6
  • 59
  • 95
  • 1
    See [Best way to disable client caching ](http://stackoverflow.com/questions/985530/best-way-to-disable-client-caching) – Matthew Flaschen Jun 16 '10 at 01:32
  • Wow, I missed your response! Good info at that link, thanx! :) – Cliff Jun 16 '10 at 01:58
  • 1
    See also: [Making sure a web page is not cached, across all browsers](http://stackoverflow.com/questions/49547/making-sure-a-web-page-is-not-cached-across-all-browsers) – BalusC Jun 16 '10 at 02:01

1 Answers1

0

I found my answer. I just added a combination of "Pragma: no-cache", "Cache-Control: no-cache", and "Expires: -1" to y response headers. Now it appears the caching is no more. I still need a solution for my broken wave headers. I really hate to engineer a wave/io package for something that should be straight forward.

Community
  • 1
  • 1
Cliff
  • 9,408
  • 6
  • 59
  • 95
  • "Pragma: no-cache" is meaningless in a server response (despite the many, many web pages which claim it has some effect). – symcbean Jun 16 '10 at 16:30
  • Yes, I see now! I haven't looked into this but I think there's still some caching going on even with these headers applied. – Cliff Jun 21 '10 at 21:27