adding Cache-Control header with value no-cache to static web resources

Cache-Control: no-cache, forces the browser to check if the resource has
not changed, before the resources is taken from cache.
This commit is contained in:
Sebastian Sdorra
2019-02-08 12:55:10 +01:00
parent 6095bcf64a
commit f17410ee3b
2 changed files with 4 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
package sonia.scm;
import com.github.sdorra.webresources.CacheControl;
import com.github.sdorra.webresources.WebResourceSender;
import com.google.common.annotations.VisibleForTesting;
import org.slf4j.Logger;
@@ -44,7 +45,8 @@ public class WebResourceServlet extends HttpServlet {
private final WebResourceSender sender = WebResourceSender.create()
.withGZIP()
.withGZIPMinLength(512)
.withBufferSize(16384);
.withBufferSize(16384)
.withCacheControl(CacheControl.create().noCache());
private final UberWebResourceLoader webResourceLoader;
private final PushStateDispatcher pushStateDispatcher;