-
Notifications
You must be signed in to change notification settings - Fork 230
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
Automatic caching not working in admin #287
Comments
DB backend doesn't matter. Maybe something else is misconfigured. |
Thanks for replying. I'm wondering if the problem is that Django Admin seems to ignore bespoke object managers? Can you confirm that cacheops supports caching on the Admin site? This probably isn't the right place to ask these kind of questions - should I just try StackOverflow instead? |
Oh, caching is disabled in admin explicitely. |
This is historical decision, I wonder whether I should turn it off in next major version, but for now it stays this way. To cache in admin you need to overwrite |
Great, thanks for confirming - I've tested out non-admin queries and everything is working correctly and performance is great. |
Just adding a note on the caching of admin design choice, if you deem it good as an added feature maybe you can add it as an op per model ? my logic here is that this would potentially be good for some models which are mainly config/setup related, but others like user model where admin is used to bulk view/alter users this would just flood redis with not needed data |
Thinking of more general approach to this. Using some form of aspects - mark them somehow and then configure to cache or not to cache things. |
hey! any update on enabling caching for admin through settings? |
please! |
@Suor I have run into this issue inadvertently by overriding Can you explain the reasoning as to why ModelAdmin querysets disable caching explicitly? I just want to better understand why this is today. |
This is needed! |
|
This might mean that |
I just wasted some time on this as well. Went into bug tracker thinking maybe there is a bug in a recent version or something. At very least it should be mention in README, but I would also vote for giving people an option to enable it for admin operation as well. Even better, make it enabled by default, as it is better for admin to be first person to see cache misbehaving than end-user. |
I'm using django-pyodbc-azure to connect to SQL Server. There isn't anything in the Cacheops docs that I could see that mentions anything about which backends are supported - but I've tried just adding
'*.*': {'ops': 'all', 'timeout': 60*60},
to the CACHEOPS config, which I think means everything should be automatically cached, and nothing gets cached at all, no errors, just nothing happens, all queries hit the database every time.
The text was updated successfully, but these errors were encountered: