I built a JavaEE backend, offering various REST endpoints. Some endpoints are only available for logged in users. To make those responses cachable by browsers, I added the 'cache-control: private' to them.
RestEasy offers that possibility by setting the field 'isPrivate' on the Cache annotation to true.
eg:
@GET
@Cache(maxAge = 60, isPrivate = true)
public SomeSensitiveData getSensitiveData() {
...
}
I also see in the response from the server, that the Cache-control is set correctly. Never the less, the server side cache from Wildfly caches the response and now everyone calling the endpoint gets the 'private' response directly from the cache.
So...uhm...is that behavior intended? If so, whats the point of the Cache-control flag 'private'?
Just for the record: I am using Wildfly 10.