that caches something into web2py, not into browser.

To cache into browser, probably the most rapid way is to send out expire 
headers in the future.

something like this would cache the file into browser for 30 days


You are using the default download function, so if you need this 
functionality you must add these lines to that function

def download():
    """
    allows downloading of uploaded files
    http://..../[app]/default/download/[filename]
    """
    import datetime
    response.headers['Cache-Control'] = 'public'
    response.headers['Expires'] = datetime.datetime.strftime(request.utcnow 
+ datetime.timedelta(days=30), '%a, %d %b %Y %H:%M:%S GMT')

    return response.download(request,db)


Reply via email to