- 论坛徽章:
- 0
|
关于浏览器缓存的问题!奇怪!
要做个上传文件功能
每次都要随即生成一个上传id
上传成功后转到成功页面
但是点击浏览器后退按钮后还是能回到上传表单的页面,但是上传表单的id还是原来的id
也就是说是从浏览器缓存取的页面,我像让那个页面不被浏览器缓存,每次都生成新的上传id
但是用了很多种方法,浏览器依然缓存那个页面,奇怪了。
用了
- <meta http-equiv="Pragma" content="no-cache">
- <meta http-equiv="no-cache">
- <meta http-equiv="Expires" content="-1">
- <meta http-equiv="Cache-Control" content="no-cache">
复制代码
在
</body>
后也加了
- <head>
- <meta http-equiv="Pragma" content="no-cache">
- <meta http-equiv="no-cache">
- <meta http-equiv="Expires" content="-1">
- <meta http-equiv="Cache-Control" content="no-cache">
- </head>
复制代码 在php里加了
- header( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' ); // Date in the past
- header( 'Last-Modified: ' . gmdate( 'D, d M Y H:i:s' ) . ' GMT' ); // always modified
- header( 'Cache-Control: no-store, no-cache, must-revalidate' ); // HTTP/1.1
- header( 'Cache-Control: post-check=0, pre-check=0', false );
- header( 'Pragma: no-cache' );
复制代码
可是浏览器依然缓存,真是奇怪了,哪位高手给指点下,谢谢了!!
我看 www.divshare.com和http://www.rapidshare.com/ 他们的上传id都是实时更新的,点浏览器后退按钮也更新上传id,并且页面都不被浏览器缓存,
不知到他们怎么处理的,晕了!!!
[ 本帖最后由 cn_en 于 2007-8-11 13:58 编辑 ] |
|