Is there an annotation with the similar name @Cache304
to facilitate setting 304 response status.
example:
@Cache304("60s")
When the GET
controller request succeeds, set 304
response status, and cache it for 60 seconds.
Comment From: bclozel
A single directive in the Cache-Control HTTP response headed is often not enough. In this case, the cache duration is not enough by itself and an ETag is often required.
In order to not multiply the number of annotations on a controller handler, we've introduced CacheControl
which brings you more flexibility and better defaults. See https://docs.spring.io/spring-framework/docs/current/reference/html/web.html#mvc-caching-etag-lastmodified
As a result, I don't think we should introduce such a feature. Thanks!