[web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Anthony
Where are you doing that append? Are you using the standard layout.html? For response.files to work, you need to include web2py_ajax.html in the layout head, after all additions to response.files. Anthony On Thursday, August 30, 2012 12:45:26 PM UTC-4, Yarin wrote: I'm trying to apply a

[web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Niphlod
Glad to see that anyone cares about that (cache busting). I'm working on that, but it has been posponed a few version away. Back to your problems: the first version should work ok. The second version is not supported, because it becomes actually /myapp/static/css/main.css%3Fv%3D1208301 the ?

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Bruno Rocha
I cant understand how versioned folders would help on this case? I ran on to this issue a long time ago and I ended using pure html for this. script src={{=URL('static', 'js', args='mylib.js')}}?{{=get_random_number()}} This works for me when I need to bypass the cache to get the proper js

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Niphlod
This case is an obvious example. I was only suggesting a better way to handle this kind of problem from a general POV. Both methods work ok, but if you set cache headers far in the future (e.g. handling static files with a webserver like apache or nginx) there is a caveat using the vars

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
So it seems like response.files has a problem with appended vars? Even when I spell out the URL entirely, it never gets output: response.files.append(/css/main.css?v=123) # Doesn't get output response.files.append(/css/main.css) # Does get output Assuming this is why rocha used html. Can we fix

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Niphlod
what version are you using ? both those notations should work ok (just tested in latest trunk and 1.99.7) Web2py does not have a problem with appended vars, it's only that if you do URL('something', 'othersomething') othersomething is escaped (correctly). Then response.include_files() tries to

[web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Massimo Di Pierro
I know you have a pending proposal. let's work on it for web2py 2.1 On Thursday, 30 August 2012 13:27:18 UTC-5, Niphlod wrote: Glad to see that anyone cares about that (cache busting). I'm working on that, but it has been posponed a few version away. Back to your problems: the first version

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
I swear both the URL(..., vars=) and the non-serialized URLs both aren't working- I'm on 1.99.7, with the code in the right place in front of include web2py_ajax.html, together with all my other working scripts and styles. optimize_css is not enabled, and doesn't appear to be any sort of

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Bruno Rocha
I tested this on a project (maybe web2py version -1.97) response.files.append(URL('static', 'css', args='myfile.css', vars=dict(v=get_random( I dont know if it is working now, but I used the plan html for doing this. --

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Niphlod
if you can pack a minimalist app to reproduce I'll be happy to help. On Thursday, August 30, 2012 10:23:36 PM UTC+2, Yarin wrote: I swear both the URL(..., vars=) and the non-serialized URLs both aren't working- I'm on 1.99.7, with the code in the right place in front of include

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Bruno Rocha
I think it is now working, I checked the source and there is: if isinstance(item,str): f = item.lower().split('?')[0] if f.endswith('.css'): s += css_template % item elif f.endswith('.js'): s += js_template % item elif

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Niphlod
Installed fine. On trunk it's ok for all cases, but for vanilla 1.99.7 the check for ? in globals.py isn't there, so both 2nd and 4th are not working. Incidentally, I had a different scaffolding app for 1.99.7 that didn't use response.include_files(), so that's because it was working for me in

Re: [web2py] Re: Versioning static files or other options for browser cache reloading

2012-08-30 Thread Yarin
Got it- I'll be upgrading to 2 so not an issue- thanks On Thursday, August 30, 2012 5:52:00 PM UTC-4, Niphlod wrote: Installed fine. On trunk it's ok for all cases, but for vanilla 1.99.7 the check for ? in globals.py isn't there, so both 2nd and 4th are not working. Incidentally, I had a