if a file is truly static we think it should be handled by the web
server and not by web2py. If instead you need an action to serve a
static file (the file is in uploads or private and you want to check
permission or do other things) you can do something like this:

def static():
    # use request.folder and response.headers[...]=...
    return response.stream(file)

On Aug 19, 1:58 am, huimies <huim...@gmail.com> wrote:
> Hi,
>
> Is there a built-in way set a query string for my static file urls or
> should I start working on my own implementation? I.e. myimage.gif?
> v=1234 where 1234 is a hash of that file. I would need this in order
> to set cache headers correctly with Nginx.
>
> If there isn't, what would be a good way to implement it? I was
> thinking about making something similar to what tornado 
> has:http://github.com/facebook/tornado/blob/master/tornado/web.py(line
> 731 onwards). My question is, what is the easiest way to make this
> class/method available in my views? I'm also not familiar with the
> request object of web2py, does it contain path to my app's static
> folder? Or can I get it from some settings object?
>
> cheers

Reply via email to