Long story short, I stopped using the CDN module on a client's site because they transferred to a transparent cdn/cache/waf/proxy. So all static files are now being served off the www subdomain, same as the website.
Upon uninstalling CDN and rolling back the patches it makes to core I discovered this bug in advagg. When advagg bundles CSS files and rewrites the paths to the images inside, it calls file_create_url which, on an unpatched Drupal install will always prefix the path with "files/". This does not happen if your Drupal core is patched for the CDN module as the function is altered. So I am guessing that this was only ever tested by someone with the patch applied (even if CDN was disabled at the time), but I am surprised that no-one else has noticed this problem before.
For example, url(css/image.png) inside a stylesheet residing in a theme directory:
With the CDN patch applied is re-written to:
url(/sites/all/themes/atheme/css/image.png)
Without the patch, i.e. vanilla Drupal it re-writes to:
url(/files/sites/all/themes/atheme/css/image.png)
... and we have missing images all over the site.
The patch attached removes the call to file_create_url() but I am unsure if this will then break things for those people who do use the CDN module.
Comment | File | Size | Author |
---|---|---|---|
#3 | advagg-2456113-3-use-pressflow-file-create-url.patch | 3.65 KB | mikeytown2 |
advagg.module.patch | 756 bytes | mr.j | |
Comments
Comment #2
mikeytown2 CreditAttribution: mikeytown2 commentedI would opt to bring in the pressflow version of file_create_url() call it advagg_file_create_url() so it will work with the CDN patch, core, or pressflow without issue.
My guess is everyone is using pressflow.
Comment #3
mikeytown2 CreditAttribution: mikeytown2 commentedHere's a patch that uses pressflows version of file_create_ur
Comment #4
mikeytown2 CreditAttribution: mikeytown2 commentedCommitted #3