All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.commercetools.sunrise.common.cache.NoCacheAction Maven / Gradle / Ivy

There is a newer version: 1.0.0-M10
Show newest version
package com.commercetools.sunrise.common.cache;

import play.mvc.Action;
import play.mvc.Http;
import play.mvc.Http.HeaderNames;
import play.mvc.Result;

import java.util.concurrent.CompletionStage;

public class NoCacheAction extends Action {

    @Override
    public CompletionStage call(final Http.Context ctx) {
        ctx.response().setHeader(HeaderNames.CACHE_CONTROL, "no-cache, no-store, must-revalidate");
        ctx.response().setHeader(HeaderNames.PRAGMA, "no-cache");
        ctx.response().setHeader(HeaderNames.EXPIRES, "0");
        return delegate.call(ctx);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy