Rework caching, no longer cache html but cache expensive queries #548
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First pass at improving #505
Instead of caching the entirety of the html, cache some of the queries that go into building the post details screen (and aren't user dependent). I added about 300 posts to the calendar to check, and there are some small improvements. Have not seen any major performance degradation, though this function now goes uncached.
I'd prefer not to remove the cache in it's entirety without some further investigation, but this PR starts to untangle some of it from the calendar. I've also tried to improve some of the calls being made to other functions to eke out some small performance improvements, and consolidate some calls to functions that didn't seem necessary
Eventually, we could consider doing some things in future PR's like: