Skip to content

Commit

Permalink
fix: Link settings are not correctly read from server and display an …
Browse files Browse the repository at this point in the history
…old config - EXO-71985

Before this fix, the links settings are server with Cache-Control = must-revalidate, and maxAge = 1year
must-revalidate means : if the asset is expired in cache, revalidate it against the server. Else, serve the cache content.
Firefox correctly implements this behaviour as Chrome revalidate assets for each request.
This behaviour means that if an admin change the configuration of the setting, a user on FF could see an old version of the configuration, until his cache is refreshed or asset expired.

The commit change the cache control to no-cache, which means : revalidate the asset for each request. As the LinkSettings endpoint correctly implements Etag feature, if the settings did not change, the service return correctly a 304 and the browser serve the cached asset. If the configuration change, the service serves the new version of the configuration.

This value is different from no-store which means no cache at all.

Resolves meeds-io/meeds#71985
  • Loading branch information
rdenarie committed Oct 17, 2024
1 parent ed75038 commit 910cd25
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ public class LinkRest implements ResourceContainer {
private static final Log LOG = ExoLogger.getLogger(LinkRest.class);

static {
CACHE_CONTROL.setMaxAge(CACHE_IN_SECONDS);
CACHE_CONTROL.setMustRevalidate(true);
CACHE_CONTROL.setNoCache(true);
IMG_CACHE_CONTROL.setMaxAge(CACHE_IN_SECONDS);
}

Expand Down

0 comments on commit 910cd25

Please sign in to comment.