-
-
Notifications
You must be signed in to change notification settings - Fork 128
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
Cache package pages intelligently #514
Comments
I'm trying to think this through (apologies in advance if the logic/wording isn't clear lol). So if I'm understanding correctly, the concern is if we have a scenario where:
The concern is the existing cached package wouldn't show the new package under "Required By" in the web ui? Can we just write two functions that:
Am I understanding the problem correctly? |
Yes. We have
Yes, the best would be to cache the metadata of a package because that only depends on Package updates. I tried this before and it was fast but my cache key was bogus so other pages showed the wrong information. The cache key for that should be:
Otherwise skip the For django template's we can create an unique cache key and destroy this cache when reading the repository metadata: https://stackoverflow.com/questions/10778988/how-do-i-delete-a-cached-template-fragment-in-django As required_by is the reverse of depends/makedepends/checkdepends we can just destroy the cache when package A updates and iterate over all of their dependsmakedepends/checkdepends and destroy the cache. Obviously reading the repository db will become a bit slower then.. |
Our packages pages can be quite slow without a cache as
package.get_requiredby()
, we could cache every package view's metadata with a common cache key orpackage-$pkgname-metadata
and bust the cache once reporead has detected changes.I don't know how often we update packages so maybe this isn't practical, or the cache is just bust all the time...
If we want to cache per package this is tricky as if I add a new package which depends on my cached package it won't show up. So either we write a smart caching busting algorithm or we don't.
Also other things influence the package page:
The text was updated successfully, but these errors were encountered: