Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using origin pull method but most of my images and some css files are not being served through CDN. I am using the Sky theme and it uses drupal_add_css with a relative css path as input. Many of the images are linked relatively as background images in css injector. The other images are from modules like quicktabs and panels. How can I ensure everything is served through CDN?
Comments
Comment #1
yang_yi_cn CreditAttribution: yang_yi_cn commentedsame here.
It looks like that the images that generated in HTML are all severed through CDN correctly.
However, background images defined in CSS files are not served at all. Those are images such as
background: url("../images/btns-small.png") no-repeat scroll -101px 0 transparent;
Comment #2
yang_yi_cn CreditAttribution: yang_yi_cn commentedis that the way it works? or I'm misconfiguring something?
Comment #3
zazinteractive CreditAttribution: zazinteractive commentedI just did it manually through search and replace
Comment #4
larruda CreditAttribution: larruda commentedI found a solution, but it means changing core code because there's no hook I searched for that intercepts the needed routine.
File: /includes/common.inc Line: 1983
Change from
To this:
Remember to identify this part with something (eg: comment) and detect/change again that when upgrading core code.
Comment #5
Wim Leers#4: that even only works when you're using CSS aggregation. When you're not using CSS aggregation, it will still fail to load from the CDN.
The solution is to use the AdvAgg module. But this needs to be documented properly.
Comment #6
Wim LeersCorrection, you'd also have to install the http://drupal.org/project/parallel_css module. Also see #1410318: Merge into CDN module?.
Comment #7
Wim LeersFound more severe problems due to this problem at #1428530: Override CSS aggregation to ensure correct file URL altering for files referenced by CSS files. This issue is now merged into that one.