I am using a CDN and am trying to configure web2py to use it instead of the classic static file service.
So far I've been using pattern-based routes like this :
cdn = 'https://xxxxxxx.cloudfront.net'
routes_in = (...
('/static/$anything', cdn + '/static/$anything'),
...
)
routes_out = (...
('/static/$anything', cdn + '/static/$anything'),
...
)
This basically works, but this has to be implemented on a pattern-based routes.py which means I lose many cool features like map_hyphen, default_application, default_controller mappings...
Is there a way to use a CDN with a parametric router ?
I read somewhere that the host parameter in URL can also be used to setup a CDN, but it seems a bit tedious to find all URL and rewrite them.
Isn't there a variable in gluon.rewrite that I can mess with to trick web2py into serving CDN-based content ?