Replies: 2 comments 3 replies
-
This is part of the query Wagtail uses to determine which site is being used for a given request, and by extension what the root page is to start resolving from. I did some work a little while ago to try and cache and simplify this query to improve performance: #8937, after which yes it'll definitely be possible to cache it. |
Beta Was this translation helpful? Give feedback.
-
Why? Optimization can prove to have been a waste of time if the optimized code is only a small part of the workload. Making a routine 10 times faster doesn't help much if that routine is only consuming 1% of the running time to begin with and it may result in more complicated and buggier code. Caching comes at a cost: more complicated code, and the overhead of caching framework itself. What about caching all queries and/or cache your complete application. Eg https://django-cachalot.readthedocs.io/en/latest/ OR https://varnish-cache.org/ OR a CDN. |
Beta Was this translation helpful? Give feedback.
-
hi, I'm a beginner of wagtail, I'm curious about something when I try the bakery demo.
here is the debug_toolbar output from bakery demo:
![image](https://user-images.githubusercontent.com/45847340/203040701-bdc032f3-f85c-4f90-9995-62582eddb306.png)
I'm concerned about why wagtail queries site info with super complicated SQL in every page request, is that possible to add a cache or assign some fixed data?
Beta Was this translation helpful? Give feedback.
All reactions