What I want:

I use a LOAD helper, which refreshes a page every second. But it would be
better to transfer this page only if it has changed. Anthony wrote on
http://stackoverflow.com/questions/14515313/how-to-modify-web2py-download-function-to-return-304-not-modified-in-case-the
how to change the header. I have added an ETag-field, but it does not seem
to work.

In order to test the idea I wrote:

def mytime():
    jetzt=str(request.now)[:19]
    mtime = "Mi, 06 Aug 2014 08:11:00 GMT"
    response.headers['Last-Modified'] = mtime
    response.headers['Pragma'] = 'cache'
    response.headers['Cache-Control'] = 'private'
    response.headers['ETag'] = "123"
    return dict(jetzt=jetzt)

request.now gives the actual time, but if "Last-Modified" and "ETag" are
always the same I think I should see the same time on each call.

Ok, it does not work - what is wrong? Any ideas?

Regards, Martin

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to