• Resolved George

    (@subscriptiongroup)


    Hello,

    This is similar to https://wordpress.org/support/topic/multi-server-3/ which didn’t provide a solution.

    We have multiple servers for the front-end sat behind a Load Balancer.

    When customer X visits page Y the LB routes the traffic to web1. AO creates the necessary files and passes them to customer X.

    The customer’s browser requests the merged/minified file from CDN and the CDN tries to get it from our LB. If the LB picks web2 to serve the file, the file doesn’t exist and a 404 is returned.

    One solution is for servers to use common storage so everything inside /cache/autoptimize is shared between them and any server can serve a file created from another one.

    Another solution is to somehow push the files to the CDN instead of have the CDN pulling them from the server.

    Another possible solution might be setting the CDN to have a fallback in case it gets a 404 from one server? This would require servers to respond to web1.site.com, web2.site.com etc so the CDN will be trying http://www.site.com and failing that, start trying web1, web2 etc.

    Any other suggestions or preference between those approaches?

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

    (@optimizingmatters)

    The easiest solution (assuming your CDN supports push) would indeed be to push any file in wp-content/autoptimize/cache to the CDN, but CDN-push is not something AO knows how to do so that gap will have to be bridged by something else (e.g. “WP Offload Media” mentioned in the other post maybe?).

    Syncing between the different webs (either automatically through a shared mounted filesystem or using something like rsyncd) would obviously also work.

    The CDN intelligently switching between webs in case of a 404 seems the least feasible as it depends on logic being implemented/ configured at CDN side.

    hope this helps,
    frank

Viewing 1 replies (of 1 total)

The topic ‘Multi-server / Horizontal Scaling’ is closed to new replies.