caching downloads does not make sense. This is because the role of
download is to check permissions to download a file (if they are set).
if you cache it then you do not check. If you do not need to check do
not use download. Use
def mydownload():
     return
response.stream(open(os.path.join(request.folder,'uploads',request.args(0)),'rb'))

or better use the web server to download the uploaded files.

On May 4, 6:11 pm, Mariano Reingart <reing...@gmail.com> wrote:
> To cache images, I'm trying to do:
>
> @cache(request.env.path_info,60,cache.ram)
> def download(): return response.download(request,db)
>
> But seems that is not working:http://www.web2py.com.ar/raf10dev/default/index
> (see images at sidebar, if you quickly reload pages, they fail)
>
> The book says something about response.render, but nothing about download...
> Anyway, I'm not sure if this is a good use of @cache, are there any other way 
> ?
>
> BTW, why Cache-Control: no?...
>
> Best regards,
>
> Mariano Reingarthttp://www.sistemasagiles.com.arhttp://reingart.blogspot.com

Reply via email to