css cache leads to weired layout

Description

We need a solution to inform browser of css changes so thad cached css will no longer be used.

Environment

None

Activity

Show:
Tilo Neumann
November 29, 2019, 9:59 AM

Properly there is a server sided solution called ETag:
https://de.wikipedia.org/wiki/HTTP_ETag

You have “just” to configure your server and you are done.

Kathleen Neumann
November 29, 2019, 6:23 PM

Here are some solution described:

https://medium.com/@codebyamir/a-web-developers-guide-to-browser-caching-cc41f3b73e7c

 

For me the Last-Modified header seems to be a better solution. But we can check if eTag works for generated css.

Tilo Neumann
December 2, 2019, 8:46 AM
Edited

The last-modified header is an weak and outdated cache control mechanism.
It is often used only as fall back for the expires settings.

As far as I know you can add the etag header for generated resources too. It is just a hash you set in the header. And when this hash is the checksum for the generated content, then it only changes, when the content has changed. And then it’s done, isn’t it?

Kathleen Neumann
December 2, 2019, 9:07 AM
Edited

We get the css file using a jersey resource from mycore. Perhaps we should add the cache mechanism there:

https://psamsotha.github.io/jersey/2015/10/18/http-caching-with-jersey.html

 

… there is also a section about caching use etag

Kathleen Neumann
December 5, 2019, 9:13 AM

Looking at mycore.de/mir shows, that we already use etags. But we also use

Cache-Control

no-transform, max-age=86400, max-age=86400

 

Assignee

Sebastian Hofmann

Reporter

Kathleen Neumann

Labels

None

URL

None

External issue ID

None

Components

Fix versions

Affects versions

Priority

Medium
Configure