Skip to content

Commit

Permalink
Revert "Do not cache non-constant assets"
Browse files Browse the repository at this point in the history
This reverts commit e05d85d.
  • Loading branch information
idlira committed Nov 29, 2023
1 parent e05d85d commit e8c5cbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/sirius/web/dispatch/AssetsDispatcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,17 @@ private void updateResponseCacheSettings(Response response, String uri, boolean
return;
}

if (!constantAsset || uri.startsWith("/assets/no-cache/")) {
if (uri.startsWith("/assets/no-cache/")) {
response.notCached();
return;
}

response.cachedForSeconds((int) defaultStaticAssetTTL.getSeconds());
if (constantAsset) {
response.cachedForSeconds((int) defaultStaticAssetTTL.getSeconds());
return;
}

response.cachedForSeconds(Response.obtainClientDurationInSeconds());
}

private String computeEffectiveURI(WebContext webContext) {
Expand Down

0 comments on commit e8c5cbe

Please sign in to comment.