Invalidate cached copy when changes are made.
Hi all,
I have a model that ruffly looks like so,
Class Member(model);
member_id = model.Integerfield(primary_key=True)
organization = model.foreignerkey(primary_key=True)
transorg = model.foreignerkey()
bo_name = model.foreignerkey()
member_create_date = model.datetimefield()
member_modified_date = model.datetimefield()
.......
class meta:
db_table = 'Member'
unique_together = ('member_id','organization')
I have a view (display members) which allows user to search
based on multiple foreigner keys, the result ruffly returns about 811
Members and takes a long time to execute. So i started using cache
which resulted in faster serving of the page but when changes are made
to one of the Member the change is not shown on the display member
page, instead it still shows the cached page, i used decorator @cache-
control(must_revalidate=True) but i figured it has a max age. I
thought I'll use @condition(Etag_func,last_modified_func,) but i'm not
clear how to use it, since I'm filtering based on multiple fields,
also my result returns 811 members, so I'll have to check
member_modified_date of 811 members??? Is there a way i can use the
cache so that it gets a new copy when i make changes.
--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home