aMytho / osse

A music server backend written in Rust (WIP)
GNU Affero General Public License v3.0
0 stars 0 forks source link

Improve/Add Caching #3

Open aMytho opened 2 months ago

aMytho commented 2 months ago

We need to add full cache support for most routes. This should be done via middleware. We need the cache-control, etag, and expires at headers. Since data rarely changes, most routes should be cached.

The etag could be a hash of the model or of the DB updated_at timestamp. The cache headers should only be added if the request is successful. The controller could set the value of the etag on the request itself (poem request extension).