Replies: 3 comments 2 replies
-
Interesting Idea. I will dedicate some time to thoroughly consider this when i get some time. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As of now, the route URLs caching system clears everything on deletion or update, and caches everything single route at one.
When a website grows, the number of pages can become quite large and this can slow down things quite a lot when editing pages.
It'd be better to have a tree-like caching structure to reflect the tree-like structure of the URLs (given the parent/child relationships in place). This will be a complete structural rewrite for the URLs system.
I suggest that a change in a parent page invalidates its own cache as well as the caches for the child routes.
I also suggest 5 new extension points:
Page#getUrlCacheKey($args = [])
To get the cache key that depends on developer-provided arguments (merged with default args)Page#getUrl($args = [])
To get the URL that depends on developer-provided arguments (merged with default args, cached by the associated cache key)Page#getDefaultUrlArgs()
To get the default arguments to merge with for the extension points abovePage#getAllUrlCacheKeys()
To get all the generatable URL cache keys for this specific page (e.g. translatable pages) ORPage#getAllCacheKeysArgs()
to get all the argument sets for the generatable URLs and their cache keysPage#getAllUrls()
To get all the generatable URLs for this specific page (e.g. translatable pages)I also suggest maintaining a URL to model-id cache (that can be partially updated when a model is deleted or saved) that would make route argument lookups much faster.
Beta Was this translation helpful? Give feedback.
All reactions