更新背景 - 想请教一下是否有延时

2010-12-20 01:22:16 +08:00
 FRHong
刚刚想换一张背景,于是把原来的 bg.png 更新之后 deploy 上去。可是不知道为什么其它文件都更新了,就是这个 bg.png 没有更新。无论怎么 F5 都更新不了。

我看了根目录的 css.py 这个文件。不知道是不是跟下面这段有关?


class CSSHandler(webapp.RequestHandler):
def get(self, theme):
template_values = {}
themes = os.listdir(os.path.join(os.path.dirname(__file__), 'tpl', 'themes'))
if theme in themes:
path = os.path.join(os.path.dirname(__file__), 'tpl', 'themes', theme, 'style.css')
else:
path = os.path.join(os.path.dirname(__file__), 'tpl', 'themes', 'default', 'style.css')
output = template.render(path, template_values)
expires_date = datetime.datetime.utcnow() + datetime.timedelta(days=7)
expires_str = expires_date.strftime("%d %b %Y %H:%M:%S GMT")
self.response.headers.add_header("Expires", expires_str)
self.response.headers['Cache-Control'] = 'max-age=120, must-revalidate'
self.response.headers['Content-type'] = 'text/css;charset=UTF-8'
self.response.out.write(output)

===
谢谢!
2877 次点击
所在节点    Project Babel
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/6080

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX