呼叫my script应在audio/mpeg
类型的浏览器中播放音频。
强制刷新时,音频会在Firefox中播放,但在第二次调用时,音频不会播放。
脚本尝试设置Cache-Control
以停止缓存。然而,浏览器似乎是缓存,并且无法检索音频内容。
第一次通话时,我的浏览器会收到:
HTTP/1.1 200 OK
Date: Thu, 08 Mar 2012 20:21:16 GMT
Server: Apache
X-Powered-By: PHP/5.3.8
Cache-Control: public, must-revalidate, max-age=0, max-age=86400
Pragma: no-cache
Accept-Ranges: bytes
Content-Disposition: inline; filename=627.mp3
Content-Transfer-Encoding: binary
Content-Length: 16299
Last-Modified: Wed, 22 Feb 2012 21:58:33 GMT
Expires: Sat, 10 Mar 2012 20:21:16 GMT
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: audio/mpeg
但是,在第二次通话时,它会收到:
HTTP/1.1 304 Not Modified
Date: Fri, 09 Mar 2012 20:21:54 GMT
Server: Apache
Connection: Keep-Alive
Keep-Alive: timeout=5, max=100
Expires: Sat, 10 Mar 2012 20:21:54 GMT
Cache-Control: public, must-revalidate, max-age=0, max-age=86400
X-Pad: avoid browser bug
...音频无法播放。
有关为什么此音频在第二次通话时无法播放的任何提示?