返回静态文件代码如下
flask.send_file('../static/js/main.js',cache_timeout=0)
request headers如下:
get /static/js/main.js?__inline=true http/1.1host: anglestreet.duapp.comconnection: keep-alivecache-control: max-age=0accept: */*if-none-match: flask-1409227359.0-21401-527044139if-modified-since: thu, 28 aug 2014 12:02:39 gmtuser-agent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) ubuntu chromium/36.0.1985.125 chrome/36.0.1985.125 safari/537.36dnt: 1referer: http://anglestreet.duapp.com/accept-encoding: gzip,deflate,sdchaccept-language: zh,zh-cn;q=0.8cookie: baeid=81f2d83ead7d00091521ba62edc1894b:fg=1;
response headers如下:
http/1.1 200 okcontent-type: application/javascriptlast-modified: thu, 28 aug 2014 12:02:39 gmtcache-control: public, max-age=0expires: fri, 29 aug 2014 15:21:59 gmtetag: flask-1409227359.0-21401-527044139set-cookie: session=eyjyb2xlijoiywrtaw4ilcj1c2vybmftzsi6imfkbwluin0.buisfw.lkeoawvqorfnylu-sk1kaz-icc4; httponly; path=/date: fri, 29 aug 2014 15:21:59 gmtserver: bws/1.0content-length: 21401
在chrome浏览器下无问题. 在微信链接中打开则经常出现版本过期的情况, 必须手动刷新
回复内容: 服务端 用的 python的flask框架
返回静态文件代码如下
flask.send_file('../static/js/main.js',cache_timeout=0)
request headers如下:
get /static/js/main.js?__inline=true http/1.1host: anglestreet.duapp.comconnection: keep-alivecache-control: max-age=0accept: */*if-none-match: flask-1409227359.0-21401-527044139if-modified-since: thu, 28 aug 2014 12:02:39 gmtuser-agent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, like gecko) ubuntu chromium/36.0.1985.125 chrome/36.0.1985.125 safari/537.36dnt: 1referer: http://anglestreet.duapp.com/accept-encoding: gzip,deflate,sdchaccept-language: zh,zh-cn;q=0.8cookie: baeid=81f2d83ead7d00091521ba62edc1894b:fg=1;
response headers如下:
http/1.1 200 okcontent-type: application/javascriptlast-modified: thu, 28 aug 2014 12:02:39 gmtcache-control: public, max-age=0expires: fri, 29 aug 2014 15:21:59 gmtetag: flask-1409227359.0-21401-527044139set-cookie: session=eyjyb2xlijoiywrtaw4ilcj1c2vybmftzsi6imfkbwluin0.buisfw.lkeoawvqorfnylu-sk1kaz-icc4; httponly; path=/date: fri, 29 aug 2014 15:21:59 gmtserver: bws/1.0content-length: 21401
在chrome浏览器下无问题. 在微信链接中打开则经常出现版本过期的情况, 必须手动刷新
问题在于cache-control: public, max-age=0,设为cache-control: private就不会缓存页面
我也遇到了同样的问题,场景如下:
在a页面只能显示点赞的数量,点击点赞图标可以进入b页面,在b页面可以点赞或者取消点赞。
现在在a页面点赞数为0,我进入b页面点赞,点赞成功以后按安卓手机的返回键回到a页面,但是a页面的点赞数并没有加1。。。 试用了很多方法也不行,楼主的问题解决了吗
