mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-15 09:46:16 +01:00
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:
@@ -261,7 +261,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.sdorra</groupId>
|
<groupId>com.github.sdorra</groupId>
|
||||||
<artifactId>web-resources</artifactId>
|
<artifactId>web-resources</artifactId>
|
||||||
<version>1.0.4</version>
|
<version>1.1.0</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package sonia.scm;
|
package sonia.scm;
|
||||||
|
|
||||||
|
import com.github.sdorra.webresources.CacheControl;
|
||||||
import com.github.sdorra.webresources.WebResourceSender;
|
import com.github.sdorra.webresources.WebResourceSender;
|
||||||
import com.google.common.annotations.VisibleForTesting;
|
import com.google.common.annotations.VisibleForTesting;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
@@ -44,7 +45,8 @@ public class WebResourceServlet extends HttpServlet {
|
|||||||
private final WebResourceSender sender = WebResourceSender.create()
|
private final WebResourceSender sender = WebResourceSender.create()
|
||||||
.withGZIP()
|
.withGZIP()
|
||||||
.withGZIPMinLength(512)
|
.withGZIPMinLength(512)
|
||||||
.withBufferSize(16384);
|
.withBufferSize(16384)
|
||||||
|
.withCacheControl(CacheControl.create().noCache());
|
||||||
|
|
||||||
private final UberWebResourceLoader webResourceLoader;
|
private final UberWebResourceLoader webResourceLoader;
|
||||||
private final PushStateDispatcher pushStateDispatcher;
|
private final PushStateDispatcher pushStateDispatcher;
|
||||||
|
|||||||
Reference in New Issue
Block a user