diff --git a/commafeed-server/src/main/java/com/commafeed/CommaFeedApplication.java b/commafeed-server/src/main/java/com/commafeed/CommaFeedApplication.java index b19a8ba6..a07a1480 100644 --- a/commafeed-server/src/main/java/com/commafeed/CommaFeedApplication.java +++ b/commafeed-server/src/main/java/com/commafeed/CommaFeedApplication.java @@ -221,6 +221,12 @@ public class CommaFeedApplication extends Application { environment.servlets() .addFilter("index-cache-busting-filter", new CacheBustingFilter()) .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, "/"); + + // prevent caching openapi files, so that the documentation is always up to date + environment.servlets() + .addFilter("openapi-cache-busting-filter", new CacheBustingFilter()) + .addMappingForUrlPatterns(EnumSet.of(DispatcherType.REQUEST), false, "/openapi.json", "/openapi.yaml"); + // prevent caching REST resources, except for favicons environment.servlets().addFilter("rest-cache-busting-filter", new CacheBustingFilter() { @Override