Cache Eviction support
- Date
Expiry for Cached Queries
Orbital now honours HTTP cache headers on HTTP responses, when a cache is enabled for a query.
As described in Caching Orbital provides ability to cache query results with @Cache
annotation:
@Cache(connection = "mycache")
find { Film[] }
Let assume that you have a rest end point returning list of films:
service FilmServices {
@HttpOperation(method = "GET", url = "...")
operation listFilms():Film[]
}
If your Rest operation returns Cache-Control header in its response,
Orbital will take the max-age
directive into account and expire the cached query result accordingly.
Here as an example response with Cache-Control header:
max-age=144004
will get Orbital to cache the Film list for 4 hours. After 4 hours, the items in the query cache will expire automatically.
Grab the docs
Read more about caching in our docs