Hey @r4nd99y,
Sorry for the late reply, it’s been a busy week.
It probably doesn’t have to do with multisite, but with the fact that your stylesheets aren’t loading from the same domain. PhastPress doesn’t support this.
Could you try disabling the plugin that moves your stylesheets to cdn.website.com (and move them back to http://www.website.com, or the same domain that your site is on)? Then CSS optimization should work as intended.
–Albert
As I said, I also tried in apache multisite and it doesn’t have a cdn.
Any way to make the plugin let you know when it can’t do something instead of failing silently?
your stylesheets ren’t loading from the same domain. PhastPress doesn’t support this.
In this case it was the same domain, just with an added subdomain.
But also, it seems phast has taken a stylesheet straight from cloudflare cdn and inlined it, so it seems it can do it.
Hi @r4nd99y,
Any way to make the plugin let you know when it can’t do something instead of failing silently?
Well, that would be nice, but at the moment there are no diagnostic features like this.
In this case it was the same domain, just with an added subdomain.
It must be the same hostname: so same domain and the same subdomain.
But also, it seems phast has taken a stylesheet straight from cloudflare cdn and inlined it, so it seems it can do it.
cdnjs.cloudflare.com
is whitelisted as a source for CSS files. That might be the reason.
It would be good to have a setting in PhastPress to add additional domains to the CSS inlining whitelist.
But if you are using PhastPress there is no advantage to having stylesheets on a separate domain, because they will not be loaded from there. When PhastPress combines resources in a single request it loads then from your main domain.
–Albert
Hi @r4nd99y,
Anyway, I understand that on your Apache environment, stylesheets are loading from the same hostname as the site itself?
If that is correct, this might have to be fixed in PhastPress.
Please confirm, and I’ll look into it.
–Albert
Yeah I got 2 basic test sites, one is regular, one is multisite.
On the regular site it touches the dashicons file for example: <style data-phast-original-src="http://wp.d/wp-includes/css/dashicons.css?ver=5.6.1" data-phast-params='{"ref":"ZGoDrksgSeI"}'>...</style>
But on the multisite site it leaves it as is: <link rel='stylesheet' id='dashicons-css' href='http://wpmu.d/site2/wp-includes/css/dashicons.min.css?ver=5.6.1' type='text/css' media='all' />
But on both sites there is <!-- [Phast] Document optimized in nms -->
appended to end so some other optimizations are done. Only difference I can think of is that one is multisite and other isn’t.
Hi @r4nd99y,
Great, thanks for the details.
I didn’t consider the possibility of a subdirectory-based multisite installation. In that case, PhastPress can’t locate the resources for inlining, since they don’t exist on the server with that path, but use a rewrite rule.
I’ve just released version 1.100 which fixes this issue. Please update to this version and let me know if that resolves the problem.
–Albert
Looks like it works now, thanks!