I created a view where a user can see any question with a tag that they marked as interesting:

mymarkedtags = MarkedTag.objects.filter(user=request.user.id, reason='good').values('tag')
return question_list(request,
                     Question.objects.filter(tags__in=mymarkedtags),
                     _('Questions with tags that you starred'),
                     None,
                     _("Questions with Starred Tags"))

When I run this on my development site (sqllite) it always works. When I run it on webfaction (mysql) I notice that if I change my "interesting tags" in the sidebar and then go to the above view it still shows me questions with my old "interesting tags". logging out/in has no effect even though in the sidebar it clearly correctly saved my changes. I thought this might be a cache issue, but i have cache set to dummy://. If I just restart my webfaction server and then refresh the above view, it gives me the correct questions with the new "interesting tags".

UPDATE: Instead of restarting my server, if I just want a while and then refresh the page it will give me the correct information. Seems like a cache issue to me?

asked 04 Jun '11, 19:20

rsp's gravatar image

rsp
41661420
accept rate: 66%

edited 05 Jun '11, 11:52

I agree that it sounds like caching. I wonder if there's any way to flush the relevant bit of cache, when the list of interesting tags is changed?

(05 Jun '11, 13:54) Andrew_S ♦

and can you find out where it's caching? I think, on webfaction, there's a chain isn't there: your osqa -> your apache -> server-wide nginx (as well as, possibly, your ISP and your browser)

(05 Jun '11, 15:17) Andrew_S ♦

ok, @Hernani answer below worked perfectly but now I have turned cache back on and it is doing the same thing again. How do I get OSQA to serve the updated data?

(11 Jun '11, 20:18) rsp

Depending on your django and osqa versions, there may be a problem with the cache library being loaded to soon, and sticking with some default values, so technically, your "dummy://" cache is not being dummy at all. Go to your settings.py file, there is a try/except block there, around line 30, trying to import the csrf middleware. Comment out the following line:

from django.middleware.csrf import CsrfViewMiddleware

Restart, and you should be ready to go.

link

answered 06 Jun '11, 05:51

Hernani%20Cerqueira's gravatar image

Hernani Cerq... ♦♦
16.8k65975
accept rate: 52%

Removed the import that caused this trouble, together with the whole try-except block. It's better to have caching than too much backwards compatibility.

http://svn.osqa.net/changelog/OSQA/?cs=1059

(07 Jun '11, 18:29) Jordan ♦♦
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×69
×44
×27
×12

Asked: 04 Jun '11, 19:20

Seen: 552 times

Last updated: 11 Jun '11, 20:18

powered by OSQA