Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top