Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 14 09:48
    Suor commented #179
  • Jan 13 04:00
    babus commented #179
  • Jan 10 19:28
    Safrone commented #271
  • Jan 10 10:51
    Suor commented #271
  • Jan 06 21:19
    Safrone commented #271
  • Jan 06 00:38
    Suor commented #419
  • Jan 05 19:48
    Ptar2020 commented #419
  • Jan 05 17:08
    ShmuelTreiger commented #420
  • Jan 05 02:56
    Suor closed #420
  • Jan 05 02:56
    Suor commented #420
  • Jan 05 02:52
    Suor commented #419
  • Jan 05 02:31
    ShmuelTreiger edited #420
  • Jan 05 02:30
    ShmuelTreiger edited #420
  • Jan 05 02:28
    ShmuelTreiger edited #420
  • Jan 05 02:27
    ShmuelTreiger edited #420
  • Jan 05 02:26
    ShmuelTreiger opened #420
  • Jan 04 17:27
    Ptar2020 commented #419
  • Jan 04 10:35
    Suor closed #417
  • Jan 04 10:35
    Suor commented #417
  • Jan 04 10:30
    Suor commented #419
Alexander Schepanovski
@Suor
you are welcome
Chetan Dhembre
@chetandhembre
it just work.. like nginx and redis respect
Alexander Schepanovski
@Suor
Thanks
Harish Sundararaj
@harishzen
Hi. I'm wondering if there is any documentation out there comparing this with johnny cache?
Alexander Schepanovski
@Suor
Johnny-cache is not supported anymore, it's working analog is django-cachalot. The main difference between cacheops and both of them is that they invalidate entire table every time any changes to it is made whereas cacheops is granular.
Chetan Dhembre
@chetandhembre
can i use cacheops without django?
as our django app using cacheops do not want to use different lib for caching
Alexander Schepanovski
@Suor
The smart part of cacheops caches django ORM querysets and other things basing on that, so I can't see how it could be used without django.
Simple and file cache might be used separately, you'll still need django as dependency and to configure them
Not sure what's the issue with the app
Chetan Dhembre
@chetandhembre
I want to use simple cache.. but at start of cacheops it expect to read config from settings file
Chetan Dhembre
@chetandhembre
got it
Chetan Dhembre
@chetandhembre
i guess still i have some issue
from cacheops.simple import RedisCache
I am importing this
Alexander Schepanovski
@Suor
You can configure django with django.conf.settings.configure()
codegeschrei
@codegeschrei
Hey there! I just wanted to ask why caching in admin is turned off?
Alexander Schepanovski
@Suor
To be extra safe. And more for historical reasons, there were lots of limitations in invalidating m2m for example.
Another reason - caching for admin doesn't make sense anyway: low traffic, high updates, different queries than in the app. Useless bloat.
codegeschrei
@codegeschrei
Thanks for your fast response, too bad though, for my project it'd be a really good thing.
Alexander Schepanovski
@Suor
You can overwrite ModelAdmin.get_queryset()
Marcio Ribeiro
@b1n_twitter
How hard would it be to make cacheops work with Django 1.6?
Alexander Schepanovski
@Suor
You can just use cacheops 2.4.3
Marcio Ribeiro
@b1n_twitter
Will check it out, thanks
Shashank Parekh
@sp1rs
Small Issue.
Let say 2 things are running parallelly, first to get the object which is cached and second the object which is saving that object (That is invalidating the cache). So is it possible that before the get operation, the cache get invalidated and we get the wrong or nothing from the 1st operation?
Matthew Egan
@mattjegan
Hey, would anyone be able to answer this cacheops question? https://stackoverflow.com/questions/44821010/connecting-django-signal-handlers-in-tests
Alexander Schepanovski
@Suor
It's impossible to say anything without test code. Signal setup looks fine, you may just not using cacheops in your test code.
Sam Buckingham
@BuckinghamIO
Does cache ops potentially have issues with prefetch_related?
Alexander Schepanovski
@Suor
No
Abhishek Menon
@mav-erick
Hey guys. Amazing project! @Suor can i cache serializers if i am using DRF using cache ops?
Abhishek Menon
@mav-erick
I am running a multitenant application using Postgres schemas. The schema varies depending on the tenant. Will it cause problems when using this package?
Alexander Schepanovski
@Suor
@mav-erick as long as there are querysets inside it should work. Many people use cacheops with DRF just fine.
If you have the same SQL for different queries you will need to use cache prefix, see https://github.com/Suor/django-cacheops#sharing-redis-instance
Abhishek Menon
@mav-erick
Hi @Suor. Thanks for the info. One final question. Will the cache be invalidated with there are changes in a related model(Foreign keys and stuff) ?
Alexander Schepanovski
@Suor
Will be invalidated for any joined models via conditions. Won't be invalidated if .select_related() object changes. .prefetch_related() creates a separate query for related which is invalidated separately, so you might want to use that if the thing with .select_related() is an issue. See all CAVEATS here https://github.com/Suor/django-cacheops#caveats
Abhishek Menon
@mav-erick
Perfect. Thanks a lot!
Nikita Vilunov
@vilunov
Hiya all! Is it possible to keep the cache of an arbitrary function hot on time invalidation? I am caching some functions and a view. Currently I'm thinking about introducing a periodic celery task which invalidates that cache and fetches the view, but maybe there is a cleaner solution
Alexander Schepanovski
@Suor
Running a function after invalidation possibly via celery .delay() is the way to go. There is no any built in way to do that and there is no way to introspect what function results were just invalidated.
Alexander Schepanovski
@Suor
You may take a look at cache_invalidated signal if that helps.
BroCheng
@wang-xi
Does anyone konw the icon for django-cacheops?
Sam Buckingham
@BuckinghamIO
Anyone able to shed some light on how I could potentially get Cacheops to fail gracefully but quickly? currently it's incredibly slow if redis goes offline
I've tried overriding the redis class but cacheops makes so many requests that it negates it and I have no way or pushing the other cache hits over to a fallback cache or just turning off cacheops dynamically
It's caused by the timeouts it seems and even a 0.1 second timeout isn't exactly fast
This is in reference to issue #327 FYI
Alexander Schepanovski
@Suor
I don't know why it takes long, you should get connection refused almost immediately
BTW, I am not a big fan of this degrade on failure feature, I sometimes regret that I've added it. Still don't understand how people can use that, if your service is still functional without cache why even use one?
Sam Buckingham
@BuckinghamIO
@Suor Funcy could potentially work, I'll take a look into that and see what I can do. Well when you give cache-ops the incorrect details it fails immediately but if redis is online but not responding it increases page load times to 20 seconds plus... I was hoping to make it so that wasn't so slow.
Your service can be functional without a cache but not as fast as it could be with a cache. Cache's can help make the most of the current resource you have without needing to completely scale out to reach the same performance. @Suor
Sam Buckingham
@BuckinghamIO
You can test our situation by running a django app with cache-ops enabled and redis setup, but opening redis and putting it to sleep using 'debug redis sleep' for a couple minutes and see how the application reacts regardless of graceful enabled/disabled
Alexander Schepanovski
@Suor
I see, I always had application that immediately died without cache, too much load