HI all,

I have a django site on dreamhost. It runs well before. As table records
grew, I introduced low level cache about queryset as document said.
Something like this:

    if not cache.get(key):
        try:
            r = Book.objects.all().order_by('-modify_date')
        except Book.DoesNotExist, e:
            pass
        if r:
            cache.set(key, r, CACHE_TIMEOUT)
    else:
        r = cache.get(key)
    return r

Now book records are about 60000. Cache backend is filesystem.

But when visit book_list page, it returned 404 or 500. I checked the cache
dir django really created the cache file there. The cache file size is about
7Mb. But file size changed every time visit the page, sometimes 4Mb,
somethimes 5Mb.

I don't know what is the problem. So I try to make the cache small:

    r = Book.objects.all()[:5000].order_by('-modify_date')

Now when I visit book_list again, everything is OK, no 404, no 500.

But can't get right books quantity.

Is this django problem or dreamhost issue or something wrong with my code?
How to solve them?

Thanks for your patience.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to