Is there any way to force https:// to be used for assets and still be able to define a theme CSS files in its .info file?
Solutions
You might need to set the base URL in the settings.php file, specifying the URL scheme.
$base_url = 'https://my.domain.name';
For a Drupal 7 site using Cloudflare CDN and a Bootstrap theme, this worked for me: Set the base URL in your settings.php file, without including http:// or https://.
$base_url = '//my.domain.name';
For another Drupal 7 site with a different theme, just removing $base_url
worked.
In both cases, I needed the site to work with secure URLs and without.
One option is to use AdvAgg as this will generate different aggregate filenames for http and https. If the issue is the cache then advagg will not fix it though.
Attach JavaScript and CSS assets when render entity using Web Sockets
Goal: Attach all the necessary JavaScript and CSS files to the page, when a rendered entity is delivered on a Web Socket event. Given: Problem: JavaScript and CSS files, needed for rendering, are not attached on the page. (E.g. scripts for display of an image gallery, lazy-loading of images). My ideas: I think that I should list all the necessary J...
How to load absolute CSS and JS assets
I would like to load CSS and JS from https://static.example.com . The typical page contains: and contains similar entries for JS. I would like to add https://static.example.com to the front of the href="URL" for both CSS and JS. I'm am aware that this can be done with a contrib module. I would like to find a hook or some other way to add this to my...
Why aren't CSS files served? There is nothing in sites/default/files/css
In my Drupal 8 installation profile, I install a theme and a lot of configuration for it. I'm using Features to install blocks/settings/views for it, but when I enable the feature Drupal stops serving ANY CSS files on page loads. I don't think it's an issue with features, because if I wait long enough, those files will be generated by Drupal and CS...