• Resolved r4nd99y

    (@r4nd99y)


    Does it work with multisite installations?

    I tested the plugin in dev env and it seems to work fine.
    Then I tested it live on one site in a multisite installation, it does something, but it also leaves stylesheets in place, doesn’t inline any above the fold CSS. Any logs I can look at? Also I get 404’s in the console for cdn.website.com/wp-content/plugins/phastpress/phast.php/[hash].q.js files, maybe something’s wrong with my nginx conf.
    Anyway, then I tested in apache multisite environment and also it doesn’t do anything with stylesheets, but it does something and adds <!-- [Phast] Document optimized in 7ms --> to the end of the doc. Don’t get 404s there at least.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Albert Peschar

    (@kiboit)

    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

    Thread Starter r4nd99y

    (@r4nd99y)

    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.

    Plugin Author Albert Peschar

    (@kiboit)

    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

    Plugin Author Albert Peschar

    (@kiboit)

    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

    Thread Starter r4nd99y

    (@r4nd99y)

    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.

    Plugin Author Albert Peschar

    (@kiboit)

    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

    Thread Starter r4nd99y

    (@r4nd99y)

    Looks like it works now, thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Multisite support’ is closed to new replies.