• Resolved gpeipman

    (@gpeipman)


    Hi,

    I’m trying to use this plug-in with WordPress servers behind load balancer. It works well with one machine but not with 2+ machines. It seems that files in cache get different names on different machines. When machine 1 provides HTML and JS or CSS is asked from machine 2 then machine 2 doesn’t have file with correct name and the result is 404.

    There’s also issue with CDN. I can let plug-in generate CDN links. It works but as cache file names vary from request to request it is actually impossible to have these cache files available in custom CDN (I’m using Akamai CDN offering from Microsoft Azure).

    Is there any way to make Autoptimize to use guaranteed file names in cache so I can use it server farm or CDN?

    With best regards,
    Gunnar Peipman

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Optimizing Matters

    (@optimizingmatters)

    Hi Gunnar;
    For a given page with identical CSS & JS, AO will always use the same filename as the “random” string in the filename is actually a hash (mathematical function that calculates a reproducable string with fixed length based on another string of whatever length) of the un-optimized aggregated JS and CSS.

    The fact that the hashes are different implies the aggregated (un-minified) CSS/ JS is different, which can be caused by something (mostly a plugin) that adds CSS selectors with different (sometimes random) names or JS variables with random(ish) names or values, often (but not always) inline.

    The configuration that mostly “safe” in this context is;
    * not ticking “also aggregate inline JS”
    * not ticking “also aggregate inline CSS”
    * excluding wp-content/uploads and wp-content/cache from CSS optimization

    If the problem persists after that you should compare the autoptimized JS and/ or CSS of one specific page between the 2 hosts and find the difference, which should allow you to identify what is resulting in different filenames.

    hope this helps,
    frank

    Thread Starter gpeipman

    (@gpeipman)

    Thanks for explanation, everything works now!

    Br,
    Gunnar

    Plugin Author Optimizing Matters

    (@optimizingmatters)

    Happy it does Gunnar, feel free to leave a review of the plugin and support here! ??

    frank

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problems with multi-server deployments and CDN-s’ is closed to new replies.