COOKIE_DOMAIN setting confusion

As cdn.mydomain.com is not part of your WordPress network, it wont be affected by your settings. The COOKIE_DOMAIN constant should only be used if you want to serve cookies from a single domain for all your sites in the network. If you omit the constant or set it to an empty value, cookies will belong … Read more

How to replace regular jquery calls with CDN calls from Google?

You should be loading jQuery with wp_enqueue_script(‘jquery’) – that way, you won’t end up with multiple instances if plugins try to load it too. To use Google CDN, place this in your functions.php; wp_deregister_script( ‘jquery’ ); wp_register_script( ‘jquery’, ‘https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js’, null, // Dependencies – none null // Version – use null to prevent WP adding version … Read more

Configuring WordPress for Amazon CloudFront Caching?

The plugin works fine; alternative you can use a own function to replace the bloginf() to your CDN-Url; Example: replace the url in content: // replace content for CDN if ( !function_exists(‘fb_add_static_content_url’) ) { function fb_add_static_content_url($content) { if ( is_admin() ) // eigentlich überflüssig return $content; $wpurl = get_bloginfo(‘wpurl’); $search = array( $wpurl . ‘/wp-content/images/’, … Read more

How does W3 Total Cache CDN URL rewrites work? [closed]

The W3 Total Cache plugin changes the URL of various files in /w3-total-cache/lib/W3/Plugin/Cdn.php in the function *ob_callback*. It uses a series of callbacks to modify an output buffer. The code runs like this: w3_total_cache.php calls $root->run(); W3_Root::run calls $plugin->run() for each plugin in $this->_loaded_plugins W3_Plugin_TotalCache::run starts an output buffer which calls W3_Plugin_TotalCache::ob_callback W3_Plugin_TotalCache::ob_callback calls w3tc_do_ob_callbacks() … Read more

Is it too late to use a CDN? [closed]

Most CDNs (including Amazon’s Cloudfront, which is what I’ve used), allow origin pull, which essentially means that the CDN pulls the required entity from, in this case, your blog, the first time someone tries to access it. If use a caching plugin like wp-supercache, or w3 total cache, they integrate with CDNs like Cloudfront to … Read more

Options for CDN with WordPress Including Supporting Plugins?

Amazon CloudFront Amazon CloudFront is an CDN ‘wrapper’ around Amazon’s S3 service. Distributions can be created from existing S3 buckets, and when a file is requested from it’s CloudFront URL it is either served from the nearest edge locations’s cache or fetched from S3 and cached. Plugins My CDN – handles URL rewriting of JS, … Read more

W3 Total Cache, CDN and theme files [closed]

You need to either Version your files (by calling it style.css?ver=xxx.xxx) and making sure your CloudFront distribution has “Forward Query strings” turned on. This is the better option, as it means that all you need to do is increment the number in the query string and CloudFront will fetch this file automatically. Manually invalidate your … Read more

How to provide a local fallback for Font Awesome if CDN fails?

The problem is that I’m pretty sure it’s impossible to check if CSS is effectively added to a page via PHP: CSS is parsed by the browser, so client side, and has completely no effect on server side. Of course, in PHP it’s possible to check if CDN is responsive or not… Option 1 Send … Read more

Bootstrap 3 Glyphicons CDN

With the recent release of bootstrap 3, and the glyphicons being merged back to the main Bootstrap repo, Bootstrap CDN is now serving the complete Bootstrap 3.0 css including Glyphicons. The Bootstrap css reference is all you need to include: Glyphicons and its dependencies are on relative paths on the CDN site and are referenced … Read more