Hot answers tagged cdn
10
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', 'http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js', array(), '1.5.1');
Update: ...
6
I remove version like this, can be easily written out to match multiple domains:
add_filter( 'script_loader_src', 'jquery_unversion' );
function jquery_unversion( $src ) {
if( strpos( $src, 'ajax.googleapis.com' ) )
$src = remove_query_arg( 'ver', $src );
return $src;
}
6
This can be broken down to a simple task by adding a custom filter.
You will need to add the following to the _send_request method within the CF_Http class in cloudfiles_http.php line 1283.
$headers = $this->_make_headers($hdrs);
//Add this line below
$headers = apply_filters('cloudfiles_headers', $headers, $url_path, $method);
This will give you ...
4
In WordPress Dashboard > Settings > Media and fill the field "Full URL path to files" with your other domain. See the screenshot below:
EDIT: I thought it would be obvious, but it isn't. Here's what you exactly need to do:
You should map your domain to point to:
public_html directory, IF it's also your WordPress installation's root directory.
...
4
You have to balance speed optimization with reality.
That means don't obsess over speed analytics, there is one thing you should be looking at in terms of satisfying users, load time (in most cases).
Test your page un-cached and then cached, you should see a noticeable difference in how fast they load, for me your site is loading around 2.5 seconds, that ...
4
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 manage much of this for you. ...
4
Its not recommended often enough, but Flickr is an excellent image host for blogs as well. Their pro account costs only $25/year. You get unlimited image, video uploads and no bandwidth limit.
If you don't want your blog image uploads populating your personal photostream, you can easily create a separate account for it. You can easily streamline your ...
4
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 files via the ...
3
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, CSS, and other theme ...
3
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 ...
3
There's a pretty simply "trick" to prevent caching, when file contents changed: Add a version number, that is set to the latest date/time you changed your file.
function wpse61738_non_cached_stylesheet()
{
wp_enqueue_style(
'style-main'
,get_stylesheet_directory_uri().'/style.css'
,array()
,filemtime( ...
2
Rackspace Cloud Files
You can sign up for Rackspace Cloud files, and pay only what you use, this can be a good way to start out, as you don't need to pay upfront for a large amount of bandwidth, that you may or may not use.
There are two plugins that work well with Wordpress and Cloud Files,
Cloud Tools plugin. This is a plugin
by Paul Kehrer, it'll ...
2
Your first issue is the fact that you're on shared hosting. The fact that 1,195 websites are using the same IP address is a dead giveaway. You're likely running into resource limits with your hosting provider.
Second is a misconception of what caching does to optimize a site. Caching helps clean up and optimize load times on the front-end of your site. ...
2
I addition to the methods you have mentioned, the biggest way to speed up your loading time is with a caching plugin.
There are many in the WordPress Plugin Directory, but my favorite is Quick Cache.
2
Scripts don't get printed at the wp_enqueue_scripts hook, but rather at the wp_print_scripts hook. That said: don't echo/print scripts, period. Instead, enqueue them properly.
Caveat: This method is Plugin territory, and should not be included as Theme code in a publicly distributed Theme.
You deregister jQuery, but the step you're missing is registering ...
2
It depends what you mean, entirely on Cloudfront.
Cloudfront is a CDN only. It can't run any server side scripting environments (PHP or MySQL), it therefore isn't possible to host a wordpress site entirely with Cloudfront.
You could alternatively use Cloudfront to host your images to improve speed. The closest way to host a wordpress site entirely on ...
2
It may seem a bit of an odd question ... but it does have a bit of an easy answer.
I've been using W3 Total Cache on a multi-server setup for WordPress for 6+ months. For this project we decided to use memcached and not varnish.
About WC Total Cache and CDN
In W3 Total Cache you only sync static files like the theme files, CSS and images to the CDN.
...
2
The easiest way to go would be to use an "Origin Pull" CDN. These sorts of delivery networks pull media directly from your site, cache it (usually for the TTL defined by your Cache related HTTP headers).
Any origin pull CDN will work fine with multi-site. You rewrite all static resource URLs in your content to the CDN, when the page loads, the resources ...
1
I found this one from the wordpress.org user jcnetsys in this topic: http://wordpress.org/support/topic/plugin-w3-total-cache-google-storage-compatibility
In the plugin-description:
Very much WIP at the moment but I've uploaded my plugin (link below).
You'll need to have a google storage account (signup is free) and have
created a bucket.
...
1
The CDN tab of wp-supercache allows you to exclude files and folders.
[edited to add]
The field exclude if substring allows entry of a comma separated set of strings (eg .php, wp-include, specialpluginjsfilename). Any file names that match against this set of values is excluded from the CDN.
So, using the example above the following would be excluded ...
1
Cache
As an addition to @Travis Pflanz answer: Cachify does it all for you and is that well coded, that you don't even need to have many options. I run it on my own site (extremly bad mediatemple - currenty switching) and I'm highly satisfied.
Minify
What I'm also doing is minifying stuff with WP Minify (can't find the link). Also good is BWP Minify. ...
1
Got the solution. Instead of using the CDN exclusion list, I use the plugin (W3 Total Cache) “Page Cache” option.
Once logged in as the administrator, go to W3 Total Cache settings (a tab called “Performance”). Navigate to “Page Cache” and then to the field named “Never cache the following pages:” Finally enter the name of the page. For example, if the URL ...
1
Use any number of CDN plugins http://wordpress.org/extend/plugins/search.php?q=CDN or a cache plugin that also suports a CDN like WP Super Cache http://wordpress.org/extend/plugins/wp-super-cache/
1
You can run all your posts on CDN, previous and new. In case CDN works on Origin Pull it is not a problem.
As far as I know lot of pay as you go providers have this option, and it is no problem to switch back anytime.
More about how Push and Pull CDN works here
I am using CDN77 and they have easy manual on how to integrate their CDN with wordpress
1
My 2 cents without being an expert
optimize your theme. Check for functions that you don't need or manually code them
check if you need all your plugins
use debug plugins to check queries
debug with Pingdom.com, blitz.io and google analytics (page speed)
use W3 cache plugin with as much enabled as possible, cache, cdn, mimize etc
optimize images
try cdn
...
1
Short answer: No.
I looked at the code in wp-includes/scriptloader.php and there is nothing that indicates an "option" about supplying the version number.
You can, however, simply put this in your footer (or header) as an explicit <script> tag. Of course, this completely defeats the whole idea of wp_register_script(), but that's true with a number of ...
1
I was in a similar situation recently and started using W3 Total Cache too.
I'm not sure what settings you have at the moment, but it's worth experimenting a bit if you can to see that you're really using W3 Total Cache to the max
For example, I originally only had Page Cache and Browser Cache checked on the main screen, but I hadn't gone into the ...
1
If you have created your subdomain using Cpanel then you don't have to do anything in regards to changing DNS records, It's all done for your. As for creating an ftp account there is a nice tutorial at the Cpanel docs section.
1
Just use the site address URL, http://example.com
From the literature: `When the custom CDN URL works, you can access all files in your site via that URL and it will be delivered through the MaxCDN content delivery network.
For example, if you normally open an image from example.com/images/example.jpg, that same image now opens with ...
Only top voted, non community-wiki answers of a minimum length are eligible