Including hostname in generated urls?

9 views
Skip to first unread message

Jon Rosebaugh

unread,
Apr 24, 2013, 5:44:56 PM4/24/13
to fans...@googlegroups.com
My application uses multiple subdomains. Currently, urls are generated as "/fanstatic/whatever", which means that if the app takes a user from subdomain a to subdomain b, resources like jquery will be unnecessarily downloaded again.

I looked at the library_url method on NeededResources and while it can take base_url into account, it doesn't have any functionality for hostnames. Is this in the works? If not, how would you like to see a patch for it?

Jan-Jaap Driessen

unread,
Apr 25, 2013, 2:53:50 AM4/25/13
to fans...@googlegroups.com, cha...@gmail.com
Hi Jon,

You can use the base_url parameter to control the URLs that fanstatic generates:

http://www.fanstatic.org/en/latest/configuration.html#base-url

We use it to offload static traffic to a "static" domain. Our paster
configuration looks something like this:

[filter:fanstatic]
use = egg:fanstatic#fanstatic
...
base_url = https://static.example.com

Hope that helps,

Jan-Jaap
Reply all
Reply to author
Forward
0 new messages