So I changed my function to this:

#7days
@cache.client(time_expire=604800, quick='SVL')
def fast_download():
   session.forget(response)
   # very basic security (only allow fast_download on 
your_table.upload_field):
   if not request.args(0).startswith("db.Images"):
       return download()
   # remove/add headers that prevent/favors client-side caching
   #del response.headers['Cache-Control']
   #del response.headers['Pragma']
   #del response.headers['Expires']
   filename = os.path.join(request.folder,'uploads',request.args(0))
   #response.headers['Last-Modified'] = time.strftime("%a, %d %b %Y 
%H:%M:%S +0000", time.localtime(os.path.getmtime(filename)))
   return response.stream(open(filename,'rb'))


developers.google.com/speed/pagespeed/
still says I should enable caching for those pictures.
any idea why its not working?

-- 

--- 
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/groups/opt_out.


Reply via email to