-
Notifications
You must be signed in to change notification settings - Fork 74
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
Query Caching #335
Comments
We already pretty aggressively blink query results so that per page queries are (mostly) only run once. Caching over a longer time period is pretty opinionated and your requirements/wants are likely to be different to those of other users. Creating invalidation rules that keep everyone happy would be a bit of a minefield. There’s nothing stopping you binding your own models or even repositories and adding caching at that level. There are some laravel packages that provide support at the model level. in short I feel you already have the capability to do this as things stand, albeit you need to code it yourself. |
Description
The overhead for queries on each page is heavy. Would it be possible to add hooks which enable caching, which busts on insert/update/delete?
These are the queries just on one simple page:
select * from "statamic"."global_sets"
select * from "statamic"."blueprints" where "namespace" is null and "handle" = 'user' limit 1
select * from "statamic"."navigations" where "handle" = 'sidebar' limit 1
select * from "statamic"."trees" where "handle" = 'sidebar' and "type" = 'navigation' and "locale" = 'default' limit 1
select * from "statamic"."entries" where "id" in ([snipped for brevity])
select * from "statamic"."collections" where "handle" = 'pages' limit 1
select * from "statamic"."blueprints" where "namespace" = 'collections.pages'
select * from "statamic"."blueprints" where "namespace" = 'navigation'
select * from "statamic"."trees" where "handle" = 'pages' and "locale" = 'default' and "type" = 'collection' limit 1
select "id" from "statamic"."entries" where "collection" = 'pages' and "site" = 'default'
select * from "statamic"."navigations" where "handle" = 'top_bar' limit 1
select * from "statamic"."trees" where "handle" = 'top_bar' and "type" = 'navigation' and "locale" = 'default' limit 1
select * from "statamic"."entries" where "id" in ('[snipped]')
Something like this in the config, using mins:
The text was updated successfully, but these errors were encountered: