Skip to content

Support cache tags #9

@coorasse

Description

@coorasse

Today dato-rails supports caching but when the cache is expired, is expired for all the queries.
See the caching part of README.
This part lacks information on how to manually use the caching, which we do at Renuo.
Anyway, all queries can (and should) be cached, but when the publish button is pressed and the /dato/publish endpoint is called, all the cache gets expired. See also the implementation.
Dato now supports cache tags and we can support that as well to have a better caching. This will allow us to expire only the necessary queries.

Cache tags can be enabled by passing a new header

https://www.datocms.com/docs/content-delivery-api/cache-tags#step-1-retrieve-cache-tags

This should be optional and default to false.

How do they work

Read more here

Possibilities

  • I see the possibility of having something implemented in the gem to manage the cache and expiration of the cache, but since most all our projects are proxied by Cloudflare, we could leverage the cloudflare cache for even better performance on static pages.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions