Thank for keeping up with my problem.
On Feb 8, 12:35 am, Philip Cooper <[EMAIL PROTECTED]> wrote:
> Pavel Skvazh at about 2/7/08 3:48 AM said:
>
> > Can you please share some code piece where you take advantage of Etag?
>
> > Ben tipped me to change base controller to look like this
>
> > class BaseController(WSGIController):
> > def __call__(self, environ, start_response):
> > response.headers['Pragma'] = 'no-cache'
> > response.headers['Cache-Control'] = 'no-store,no-cache,must-
> > revalidate,max-age=0'
> > return WSGIController.__call__(self, environ, start_response)
>
> > but this made no difference...
>
> If some proxy doesn't respect those headers then etags probably won't
> help.
>
> I think your problem might be more basic and I apologize if this is
> way NOT the case.
>
> If you don't use authkit...what do you use. Basic auth means that you
> aren't logged out until you quit the browser (which you said does
> work). The real question is, what makes you think someone is logged
> out. Do they click a "logout" button or something. Clearing the
> beaker cache will keep the server from rerendering the page as was
> (which it does not do).
The way I'm doing things is
When user logs in i get info about him from DB and write to session:
session['user_info']=user_credits['info']
session.save()
Then when i want to log the user out i go:
if is_logged_in:
session['SA_sess'].close()
session.invalidate()
session.save()
response.headers['Cache-Control']='no-cache, no-store, must-
revalidate'
c.header_url = '/'
return render('portal/log_in.mako')
>
> You might test a little more. You can manually inspect (or brutally
> delete) the beaker cache between the logout and the refresh. That
> narrows down blame.
I did a little research and that's what i found out.
First i plugged in the main template a check if user is logged in -
display his role.
Then i log in with one role, play a little, log out then with the
other and log out.
What happens is really amazing and confusing.
On some pages, where I've been as 1st role - 1st is displayed, where
with the 2nd - 2nd role, where I haven't been - log in box is
displayed.
Cleared cookies - nothing changed. Got to another PC in the Lan (same
IP with mine) - everything's exactly the same. The pages are exactly
the same: Different roles on different pages.
The only explanation I can see here is that my proxy just caches the
page and doesn't care what headers i attach.
Here's what Firebug says about the request and response on the main
page
Response Headers
Date Sat, 09 Feb 2008 08:47:57 GMT
Server PasteWSGIServer/0.5 Python/2.4.1
Content-Type text/html; charset=utf-8
Pragma no-cache
Cache-Control no-store,no-cache,must-revalidate,max-age=0
Via 1.1 ******
Vary Accept-Encoding
Content-Encoding gzip
Content-Length 1964
Request Headers
Host *****
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.11)
Gecko/20071127 Firefox/2.0.0.11
Accept text/xml,application/xml,application/xhtml+xml,text/
html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5
Accept-Language ru-ru,ru;q=0.8,en-us;q=0.5,en;q=0.3
Accept-Encoding gzip,deflate
Accept-Charset windows-1251,utf-8;q=0.7,*;q=0.7
Keep-Alive 300
Connection keep-alive
Authorization Basic cGF2ZWw6bmFpZjJ0
>
> Also from the browser, how does the user "refresh" when he sees the
> same data. Clicking a "back" button, a "refresh" button and holding
> shift while clicking the refresh button are three different things (on
> ff at least).
Sometimes F5 or Ctrl+R solves the problem, but sometimes it doesn't.
Also it looks like there's some timeout, during which proxy holds the
cached page and then refreshes it.
>
> Hand in hand with that, is the behavior consistent with multiple
> browsers (ff opera safari and God forbid ie).
It is.
>
> Also, in ff you can delete the cookie and then refresh the page.
>
> Hope it helps
>
> --
> Phil
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---