【发布时间】:2017-08-23 16:45:52
【问题描述】:
Chrome 会加载 javascript 文件,但当我更新文件时,更新不会出现在 Chrome 中。我在 Firefox 中尝试过,刷新页面时可以看到 javascript 文件已更新,但在 Chrome 中没有。
我正在使用 Flask,javascript 文件位于静态文件夹中。我的目录如下:
app
-env
-lib
-static
--css
--img
--js <-- there is where my js file is
-templates
--partials
-app.yaml
-main.py
-requirements.txt
我的 app.yaml 文件是:
runtime: python27
api_version: 1
threadsafe: yes
# Handlers define how to route requests to your application.
handlers:
# This handler tells app engine how to route requests to a WSGI application.
# The script value is in the format <path.to.module>.<wsgi_application>
# where <wsgi_application> is a WSGI application object.
- url: .* # This regex directs all routes to main.app
script: main.app
【问题讨论】:
-
您是否尝试在 chrome 开发工具中禁用缓存(Ctrl + Shift + i)?网络选项卡顶部的复选框用于禁用缓存。必须打开开发工具窗口才能使任何选项起作用。
-
哇,是的,谢谢@Derek,这完全有效!您应该将其作为官方答案来回答!
标签: javascript google-chrome google-app-engine flask