Support » Plugin: Fast Velocity Minify » no css file processed in multisite

  • Resolved Amin

    (@aminima)



    Hi there,
    I have installed this plugin in my network which has a main blog and 2 other blogs in subdomain. I mean example.com, blog1.example.com, blog2.example.com

    I’m using a static subdomain to make the wp-content folder cookie-free by this way:

    define("WP_CONTENT_URL", "http://static.example.com");
    define("COOKIE_DOMAIN", "example.com");
    

    All three blogs are using a single same theme.

    I have set up the main blog successfully, and everything is working. JS and CSS files are created by Fast-Velocity plugin. But the problem is other blogs. JS files are processed but there is no CSS file.

    Please help me to find the issue.
    Thanks in advance

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Raul Peixoto

    (@alignak)

    Hi,

    FVM doesn’t support merging of “external urls”, where “external” is any url that doesn’t match home_url or site_url

    The cookie domain micro-optimization is usually done via a cdn, or by mapping the subdomain to the same virtual host.

    Example: If you configure your server’s “virtual host” to serve the same contents (same root directory) for example.com / http://www.example.com / static.example.com, you could use w3 total cache (cdn option) and FVM cdn option, to make it work, “without” changing WP_CONTENT_URL

    Regardless of this, bare in mind, that if your main site url is “without www” it’s going to be difficult to make sure your subdomains stay without cookies.
    You have to make sure, nothing sets cookies on .example.com (including google analytics and other tracking scripts)… so make sure you test on pigdom or whatever.
    Read for some insights: https://stackoverflow.com/questions/14151926/setting-up-a-cookie-less-sub-domain

    You could get another domain name such as yourdomaincdn.com and map it to the virtual hosting too, then use the cdn configuration options. Because the domain would be mapped to the same root directory, it would work.

    Also, note that if you use cloudflare on your subdomain, you cannot escape having cookies, as those are from cloudflare themselves.

    That being said, if you’re doing such micro (usually useless) optimization for speed, you should look into using a cdn such as bunnycdn (the best in my opinion) or maxcdn.
    This would give you an external domain and you wouldn’t need to bother with cookies and paths anymore.

    Thank you for this informative answer.
    But the question is so why JS files are being processed?! If this scenario is correct, so neither JS nor CSS files should be processed.

    Plugin Author Raul Peixoto

    (@alignak)

    It can be a lot of things, so I would have to see your setup to be sure.

    Are all your css files enqueued properly with wp_enqueue_style ? And are your scripts enqueued with wp_enqueue_script?

    And by the way, you haven’t disable css processing on the options, and your ignore list doesn’t have a short word on it (it works as wildcard), right?

    No other plugin or some theme setting, already optimizing js delivery but not touching css (you should disable other merging and minification options outside of FVM)?

    What do the status logs show? Are there any css generated?
    Are the paths correct or something else?

    Are all your css files enqueued properly with wp_enqueue_style ? And are your scripts enqueued with wp_enqueue_script?

    Yes

    And by the way, you haven’t disable css processing on the options, and your ignore list doesn’t have a short word on it (it works as wildcard), right?

    Right

    No other plugin or some theme setting, already optimizing js delivery but not touching css (you should disable other merging and minification options outside of FVM)?

    No other optimizing plugin is active. Except iThemes security plugin (in multisite).

    What do the status logs show?

    Where is that? I can’t find any log or status page.

    Plugin Author Raul Peixoto

    (@alignak)

    It’s on the status page.
    If you see the status page and you don’t see any view logs button, it means no files have been generated. Sometimes files are created but they are empty.

    https://www.youtube.com/watch?v=St7aAUSgPRY

    Are there any css generated?

    Some Js files are created, but all of them are related to wp-includes and wp-admin
    No one are related to the themes or plugins.

    and no CSS file is created.

    Plugin Author Raul Peixoto

    (@alignak)

    That should reply to your question of why some js files are generated while css files are not. As I explained, FVM doesn’t merge external urls, and a subdomain is considered external because it doesn’t match the home or site url.

    You are defining WP_CONTENT_URL which doesn’t include wp-includes or wp-admin, so those remain local, and can be captured by FVM.

    You would get much better performance with FVM without the static subdomain (less http requests) than with many files without cookies. Have you checked the size of your cookies to see if it’s even worth to bother?

    Thank you for this advice.
    I disabled WP_CONTENT_URL and now FVM works on subdomain blogs.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘no css file processed in multisite’ is closed to new replies.