Thursday, January 9, 2014

Re: need django.cache advice

Den 09/01/2014 kl. 21.28 skrev Sells, Fred <fred.sells@adventistcare.org>:

> I was thinking about updating the data (queryset) once a minute on a cron job and saving that in the django.cache
>
> Then each terminal would access the cache and and get the subset that applies to them.
>
> Does that make sense? Is there a better way?

1000 records from 6 tables shouldn't be a problem if your database is properly indexed. Databases are good at caching query results and not doing excess work when the data hasn't changed. Maybe the first request from a terminal will be slow(ish), but the rest should be fast.

What sort of performance problems are you having? How fast is it now, and how fast do you need it to be? Have you profiled the requests from the terminal and determined that the culprit is indeed the database?

You could go with your own suggestion, you could create a database view, you could cache the result in Varnish if the terminals are doing HTTP requests. But it depends on where in the stack you are wasting time.

Erik

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/A179517C-499F-4C28-8B77-101A554B1885%40cederstrand.dk.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate