質問

I've read that I can use /stylesheets/default.css?{{ App.Version }} for the versioning of the css files on Google App Engine. How does it work? I tried putting the ?{{ App.Version }} at the end of my css files but it brokes the whole page. Am I doing something wrong?

役に立ちましたか?

解決

You don't put version info at the end of your filename, you just append a "version" query parameter when you reference the CSS resources.

  1. Don't change CSS/JS (or other static file) filenames, just change contents
  2. Refer to those files in your HTML via <link rel="stylesheet" type="text/css" href="//host/path/file.css?version">
  3. Everytime you change contents you increase version. You could also use application versions, but you'd have to make sure they do not repeat.
  4. Default caching on static files is 10min. You can set your own cache expiration.

他のヒント

You should append the version number, i.e. (for Java):

String version = SystemProperty.applicationVersion.get();

You can append this string to your CSS file name in your host page.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top