To disable HTTP cache with the following headers:
...for all requests add the
Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0
mvn quarkus:add-extension -Dextension="quarkus-undertow"
With the added extension, Quarkus understands the "Undertow Predicate Language", which can be
used to manipulate the HTTP request and responses. Quarkus expects the configuration file:
undertow-handlers.conf to be located in
(same directory as
The built-in Disable Cache Handler with the name
disable-cache already sets all the necessary headers.
Caching of all GET-requests (JAX-RS, Servlet and static content), can be disabled with the following line in
method(GET) -> disable-cache
curl -i localhost:8080 generates the following output:
See you at Web, MicroProfile and Java EE Workshops at Munich Airport, Terminal 2 or Virtual Dedicated Workshops / consulting. Is Munich's airport too far? Learn from home: airhacks.io.
HTTP/1.1 200 OK Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: 0 (...)