Pregunta

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?

¿Fue útil?

Solución

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.

Otros consejos

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top