Google App Engine: How to disable cache on 'static' files, or make cache smart

后端 未结 2 1643
春和景丽
春和景丽 2020-12-31 08:54

I\'m using the app engine locally, and sometimes the JS files are being cached between page refreshes, and it drives me crazy because I don\'t know if there\'s a bug in the

2条回答
  •  無奈伤痛
    2020-12-31 09:31

    A common practice used by the major sites is to cache documents forever but include a unique identifier based on the release version or date into the url for the .js or .css call. For example:

    
    

    This way you get optimum caching as well as always up to date files. The only trick is to figure out how to include an up to date version number in your url, which you can automate based on your deployment environment.

提交回复
热议问题