remove response caching

Turn out, that caching on the client side does not play well when new
data is loaded into the system.
This commit is contained in:
2018-05-10 17:52:13 +02:00
parent b61a34a0e6
commit 47e32bb6b1
5 changed files with 6 additions and 32 deletions

View File

@@ -36,7 +36,6 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.http.CacheControl;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
@@ -69,9 +68,6 @@ public class PdbController implements HardcodedValues, PropertyKeys {
@Value("${" + PRODUCTION_MODE + ":true}")
private boolean modeProduction;
@Value("${" + CACHE_IMAGES_DURATION_SECONDS + ":" + CACHE_IMAGES_DURATION_SECONDS_DEFAULT + "}")
private int cacheDurationInSeconds;
public PdbController(final PerformanceDb db, final Plotter plotter) {
this.db = db;
this.plotter = plotter;
@@ -134,9 +130,7 @@ public class PdbController implements HardcodedValues, PropertyKeys {
final PlotResponseStats stats = PlotResponseStats.fromDataSeries(result.getDataSeries());
final PlotResponse plotResponse = new PlotResponse(stats, imageUrl, thumbnailUrl);
final CacheControl cacheControl = CacheControl.maxAge(cacheDurationInSeconds, TimeUnit.SECONDS);
return ResponseEntity.ok().cacheControl(cacheControl).body(plotResponse);
return ResponseEntity.ok().body(plotResponse);
} catch (final NoDataPointsException e) {
throw new NotFoundException(e);
} finally {