Ahah! One step closer to app level routes! -Thadeus
On Mon, Mar 15, 2010 at 11:15 AM, mdipierro <mdipie...@cs.depaul.edu> 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" <nat...@freezable.com> 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 <mdipie...@cs.depaul.edu> 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" <nat...@freezable.com> 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 web...@googlegroups.com. > To unsubscribe from this group, send email to > web2py+unsubscr...@googlegroups.com. > 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 web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.