I was just raising the point that if we are going to have routes for
static files, why not have routes for the app while we are at it?

At least this way, the routes would be more "portable" so that routes
can then be packed along with your app?

Or would this be trying to open a can of worms that should stay closed?

-Thadeus





On Mon, Mar 15, 2010 at 12:08 PM, mdipierro <[email protected]> wrote:
> shold this problem be solved as part of an app-level routes? I was
> looking at it as different.
>
> On Mar 15, 11:42 am, Thadeus Burgess <[email protected]> wrote:
>> Ahah! One step closer to app level routes!
>>
>> -Thadeus
>>
>> On Mon, Mar 15, 2010 at 11:15 AM, mdipierro <[email protected]> wrote:
>> > You raise a good point. There is no way to do it because I assume on a
>> > production system this should be done by the web server.
>> > Perhaps we should have something like routes.static.py in the static
>> > folder with cache configuration options for the files in there.
>>
>> > On Mar 15, 11:00 am, "mr.freeze" <[email protected]> wrote:
>> >> Yes, static files.  I am basically asking how to set the cache control
>> >> headers for static files.  Models don't get processed so I'm not sure
>> >> where to do it without hacking main.py. Am I thinking about this
>> >> wrong?
>>
>> >> On Mar 15, 10:37 am, mdipierro <[email protected]> wrote:
>>
>> >> > Static files? In the end it is the browser that caches them. web2py
>> >> > does not ask the browser to cache them.
>>
>> >> > You can try serve them using a custom controller. In this case web2py
>> >> > would do (under the hood):
>> >> >             response.headers['Content-Type'] =
>> >> > contenttype('.'+request.extension)
>> >> >             response.headers['Cache-Control'] = \
>> >> >                 'no-store, no-cache, must-revalidate, post-check=0,
>> >> > pre-check=0'
>> >> >             response.headers['Expires'] = \
>> >> >                 time.strftime('%a, %d %b %Y %H:%M:%S GMT',
>> >> > time.gmtime())
>> >> >             response.headers['Pragma'] = 'no-cache'
>>
>> >> > The browser may still ignore it.
>>
>> >> > On Mar 15, 10:23 am, "mr.freeze" <[email protected]> wrote:
>>
>> >> > > What is the best way to prevent caching of all files in a subfolder of
>> >> > > static from being cached.  The files are served by web2py. Any help is
>> >> > > appreciated.
>>
>> >> > > Thanks,
>> >> > > Nathan
>>
>> > --
>> > You received this message because you are subscribed to the Google Groups 
>> > "web2py-users" group.
>> > To post to this group, send email to [email protected].
>> > To unsubscribe from this group, send email to 
>> > [email protected].
>> > For more options, visit this group 
>> > athttp://groups.google.com/group/web2py?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups 
> "web2py-users" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/web2py?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en.

Reply via email to