-
Notifications
You must be signed in to change notification settings - Fork 5
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
Improved page loading #546
Conversation
Unlike findSingleResult, the getContentById method uses the cache in GitContentManager. This should speed up loading commonly-accessed pages.
Same as 33e71c1 but for general pages.
Same as 33e71c1 but for page fragments.
We now consistently use the cache-based getContentById. The only other difference (beyond this old method lacking caching) is that this errored out if more than one piece of content matched, but I think that's no big loss.
Codecov ReportPatch coverage has no change and project coverage change:
Additional details and impacted files@@ Coverage Diff @@
## master #546 +/- ##
==========================================
- Coverage 27.70% 27.69% -0.01%
==========================================
Files 504 504
Lines 22931 22933 +2
Branches 2837 2835 -2
==========================================
Hits 6352 6352
- Misses 15979 15981 +2
Partials 600 600
☔ View full report in Codecov by Sentry. |
We removed the type this corresponded to in 72cb910
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Shared DO cache between users should hopefully make a visible difference to response times for these endpoints.
None of these methods used question attempts, and locally there is not much difference between the speed of the old method and the new one. Sometimes it could be 75% faster, sometimes the same time; it was never worse which is good enough for me. I expect better results on the server (where the cache is helpful and other things are happening in the API).
We now consistently used
getContentById
for loading pages and fragments of all kinds, and sofindSingleResult
can and has been removed. The code is easier to read since all the methods are very similar to one another. A later improvement might be to reduce the code duplication.