Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support cache tags #9

Open
coorasse opened this issue Sep 19, 2024 · 0 comments
Open

Support cache tags #9

coorasse opened this issue Sep 19, 2024 · 0 comments
Assignees

Comments

@coorasse
Copy link
Member

coorasse commented Sep 19, 2024

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.
@coorasse coorasse self-assigned this Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant