Articles of cdn

Change WordPress Resource URL

I have recently finished developing my latest WordPress theme for my own site and as usual I was going to use maxcdn and w3tc to make it faster! However my Hosting company have started up their own cdn service and I have got 3 months free to test it out! However it is not as […]

Missing dns-prefetch link when using “nested” wp_register_style

Given this script: function register_styles(){ wp_register_style(‘google-fonts’, ‘//fonts.googleapis.com/css?family=Oswald|Open+Sans’); wp_register_style(‘bootstrap’, get_template_directory_uri() . ‘/css/bootstrap.min.css’, array(‘google-fonts’)); wp_register_style(‘font-awesome’, ‘//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css’, array(‘bootstrap’)); } add_action(‘init’, ‘register_styles’); function enqueue_styles(){ wp_enqueue_style(‘font-awesome’); } add_action(‘wp_enqueue_scripts’, ‘enqueue_styles’); Styles are rendered correctly, but I get only one dns-prefetch link: <link rel=’dns-prefetch’ href=’//maxcdn.bootstrapcdn.com’ /> Instead, since font-awesome depends on bootstrap that in turn depends on google-fonts, I’d expect a dns-prefetch […]

Is it possible to load wp-content/uploads from another server?

I just recently moved to my new CentOS server and I did a fresh installed and before I use to be with my Mac OS [Xserver] So what happen I was thinking about CDN and though that maybe this will somehow apply to some of the condition where it will make my site load faster […]

Change the URL of an image from wp_get_attachment_image_src

I call a lot of images with wp_get_attachment_image_src() and would like to off load those images to a CDN. Is there a filter to grab the URL and change it?

Is my host the problem?

I’ve been working on my WordPress Site for quite some time now, and it’s about ready to be deployed. One major issue, though – it’s VERY SLOW! At first I thought that the 20 second load time could be attributed to the 100+ images on each page; however, after some analysis, I’ve come to find […]

force_ssl_admin() causing issues with preview links

I have recently enabled my WordPress website to use an SSL Cert for administration/login pages. I am using the plugin W3 Total Cache with my Content Delivery network. I have noticed that when I am viewing all posts and click on the preview link, it sends me to a still secured web-page that is NON-relevant […]

Fall Back Google CDN in JavaScript

In HTML5 Boilerplate it Grab Google CDN’s jQuery with this JS code <!– Grab Google CDN’s jQuery, with a protocol relative URL; fall back to local if offline –> <script src=”//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js”></script> <script>window.jQuery || document.write(‘<script src=”js/libs/jquery-1.7.1.min.js”><\/script>’)</script> I tried to transpose it to WP with this PHP code function sbi_cdn_jquery() { global $wp_scripts; wp_deregister_script(‘jquery’); echo ‘<script src=”//ajax.googleapis.com/ajax/libs/jquery/’ […]

Amazon S3 + Cloudfront with WordPress

I put together a wordpress site on a heroku free instance and I’m making all images to go to an S3 bucket and a Cloudfront distribution with this plugin . The thing is, it only uploads the images to S3 and serves them with the proper CNAME I set up. What I want is to […]

Host wp-content on other domain, much like a CDN

Would it be possible to host wp-content on another domain, so that all the uploads and images would go and load from there? If so, how would I go about configuring wordpress to do this, preferably without using a third-party plugin?

How does W3 Total Cache Load Images In Stylesheet via CDN?

W3 Total Cache uses all the PHP / WordPress API trickery at hand to make sure all static content (CSS, JS, Images, etc.) is served from the CDN URL. But how does it make sure that even the images referenced in my CSS/stylesheet file are also served from the CDN URL? I checked my CSS […]