2 Servers for website and media files (Wordpress Plugin Needed) - wordpress

I am needing to host media files on one server (with a different domain name) and have my website (files) on the other. I have all Wordpress base websites and am needing all current files to be moved to the other domain/server. I cannot do this manually as there are over 10,000 media files all up. Is there any plugin that allows to do this? Or any other way to do this? I am doing this to reduce the average CPU load / memory requirement. Thanks

If you are having performance issues with WordPress, my first recommendation would be to make sure you are using a caching plugin such as WP Super Cache or W3 Total Cache (I happen to use the latter). You will need to use a persistent caching option as well for the best performance, such as Memcached.
I can only speak to W3TC, but it does have an option to server your static content via a CDN such as RackSpace CloudFiles. When configured properly it will move files from your media library to the CDN, and replace the links in your content to the proper URL.
If performance is your main interest, you should also look at serving your site via Nginx and php-cgi, managed through something like spawn-fcgi. There are some caveats to using Nginx vs Apache, but once tuned the performance is far superior. You can find a guide for the configuration on the WordPress site.
Lastly you can set up a reverse proxy from your front end server to point to static files hosted on a different server - the content just passes through your front end server. This can be accomplished using Apache or Nginx, but the performance will be better in the latter. Please see my site for an example of using an Nginx reverse proxy - you would just want to proxy requests for your static files location to a different back-end server.

Related

CDN or download into directory?

Haven't found many resources for this - If I wanted to use jQuery in my app, for example, would it be more beneficial to download jQuery into my project's directory, or to link the google CDN for use?
CDN -
Less Latency
Using a CDN: Using a CDN helps bring resources closer to the user by
caching them in multiple locations around the world. Once those
resources are cached, a user’s request only needs to travel to the
closest Point of Presence to retrieve that data instead of going back
to the origin server each time.
Without CDN - Offline test localhost
You can test your website on your local machine without network
connectivity if you serve your libraries locally while in development.
Without CDN Monkey Patching
You can modify and fix certain issues in a library that create
breaking issues in your software and host these. If you use a CDN you
will have to use the original library's code instead thus losing these
fixes.

AWS CloudFront + CloudFlare: Using Alternate Domain Names (CNAMEs)

I have the following setup:
- A WordPress Site hosted on hostgator.com
- DNS managed through cloudflare.com
- Amazon CloudFront used as CDN for Media, CSS & JS files (configured through W3 Total Cache WordPress Plugin)
On the pingdom.com Website speed test I get the message "This page makes 43 parallelizable requests to "mydomain.com". Increase download parallelization by distributing these requests across multiple hostnames." So this is what i'm trying to accomplish.
Amazon CloudFront is already working and serving files like this "1234567.cloudfront.net/wp-content/.../image.png". Now I want to parallelize hostnames and have something like "static1.mydomain.com, static2.mydomain.com etc."
I added those CNAMEs to my CloudFront Distribution and also to CloudFlare like this:
"static1.mydomain.com is an alias of 1234567.cloudfront.net"
I assume it should be working now or am I missing something?
CloudFront should serve files to any domain alias that is setup in the distribution 'alias' list section. Read the fine print to see how to separate between multiple aliases. Once you set it up and save, add the domain aliases to cloudflare and you should get the same file response on both aliases.
Note: in the last 12 months or so, we had significant improvements in how modern browsers fetch files and domain sharding is now considered a thing of the past.

Dependencies that must be done away with for using CDN

I wanted to know that, is there some special requirement for a website to make use of CDN ?
i mean is there some special scheme(or atleast considerations) on which your website must be build right from the start to make use of CDN (Content delivery network).
is there anything that can stop a website from making use of CDN, for example the way it references the content files, static file paths or any other thing conceivable.
Thanks
It depends.
You have two kinds of CDN services:
Services like AWS Cloudfront that require you to upload the files in some special place that they read from (eg. AWS S3) - In this case you need have a step in your build process to correctly upload the files and handle the addresses somehow inside your application
Services like Akamai that just need you to change and tweak your DNS records so they will serve the request to your users instead of you - In this case you would have two domains (image.you.com and image2.you.com) and have the image.you.com pointing to Akamai and image2.you.com pointing to the original source of the file. Whenever a user requested an image in Akamai, they would come to you through the "back door", fetch it and starting serving that file always.
If you use the second approach it's really simple to have a CDN supporting your application.
There are a whole bunch of concerns when dealing with CDN solutions.
The first one is that a CDN can't serve a dynamic page - i.e. a page that is unique to every user. Typically, that includes PHP, ASPX, JSP, RubyOnRails etc. - so if you're hoping to support lots of users for a dynamic site, you have to come up with another solution. Some CDN providers support "Edge Side Includes" - this allows you to glue dynamic pages together with cached content on the CDN, but this creates quite a complex application.
Of course, even on a dynamic application, a CDN can still serve static files - images, stylesheets, javascript files, videos etc.
#Tucaz explains the two major options here (actually, Akamai also provides a "filestore" CDN option). If you select the second option - effectively, the CDN becomes a caching reverse proxy in front of your website - it makes sense to tweak the cache headers on your HTTP server, and tell the CDN to honour those. Make sure you set your .ASPX files to not cache!

Drupal site performance

I have used Drupal 6 for my multilingual website. I am getting issue of site performance I have enabled the cache setting of drupal but it still going slow when move from one page to other.
I have also used boost module but it’s not comfortable for multilingual website.
Please tell me any other way so I will improve performance. Thanks in advance.
your question has a whole host of answers, instead of listing all (which i would have to copy from several sites), here are a few main ones, and some resources i'd recommend:
-> Turn off all modules you are not using
-> Turn on caching
-> Try using the memcache module
-> Enable drupal JS and CSS aggregation, so we would have less files to load, meaning less HTTP requests
-> Use a CDN
-> GZIP contents
-> Minify Javascript
-> Avoid Redirects
-> Reduce Duplicate Scripts
Some Resources I would Recommend
http://wimleers.com/article/improving-drupals-page-loading-performance
http://drupal.org/node/326504
http://groups.drupal.org/node/85979
http://groups.drupal.org/node/195218
http://www.bootstrappingindependence.com/technology/how-to-improve-website-performance-with-drupal-php-mysql-and-apache/
http://www.vmirgorod.name/blog/tuning-drupal-performance
http://pronovix.com/blog/my-favorite-drupal-performance-hacks
http://fenix-solutions.com/blog/2009/12/09/tips-for-improving-drupal-performance/
http://drupalst.com/blog/improving-drupal-performance
The same issue I have faced in one of my application, I have worked on the following steps and it increases the performance which I verified through YSlow and GooglePageSpeed.
If you are using Apache, Replace Apache with NGINX as the web server for your Drupal site. This improves performance and reduces memory utilization when thousands of connections run concurrently. (Apache allocates memory to every additional connection, so it tends to start swapping to disk as concurrent connections increase)
Implementation of reverse proxy server. NGINX is a very popular reverse proxy server for Drupal sites. Implementing a reverse proxy server removes the burden of handling Internet traffic from your application server and allows other performance‑enhancing steps: caching of static files and the use of multiple load‑balanced application servers.
Implementation of CDN (Content Distribution Network)
Implementation of browser level caching at server level
Should enable Compression of images, CSS and Javascript files.
You can use Akamai for node/page level caching as a result it will increase the performance.
Use image sprites (css3embed), avoid iframes if you are using
Index database tables (use dbtuner)
Use of adding an Expires header
Disable DbLog module if not in use.
Move your assets at bottom
Reduce DNS lookups
Hope it would help.
Thanks
you need realy fast hosting, i recommend use nginx with phpfpm. without any var or opcode cacher your perfomance will be just incredible. im my vps i have speed up big drupal site to 200ms per page
and of course you must to audit your site for slow queries (big views, many blocks or php code).

resources on secured web site

We have a web site in the domain, let's name: http://website.com. It is necessary to implement same look-and-feel on another web site (https://custom.website.com). As we can see, the 2nd is in the sub-domain of the 1st one, but it is secured (it uses https).
To achieve same look-and-feel same DLLs are used in both web sites. These DLLs contain functionality for menus, JavaScripts, etc). But the 2nd web-site uses images and some css files from the 1st one. For example, in order to display "Logo.png" instead of usual "~/Images/Logo.png" the following path to file is rendered into HTML: "http://website.com/Images/Logo.png"
All stuff was done on the local environment, and work perfect (http://localhost/ referred to http://website.com).
BUT, when web-site was deployed to 'real' (development) environment we got surprise: IE notifies:
webpage contains content that will not be delivered using a secure HTTPS connection
I see option to resolve an issue: we could include images into secured web site and use them locally, but in this case we will need to do redeployment if something changed on the main web site.
Question: is there any workaround, how from secured web site we could use images that are located on the non-secured.
Thanks. Any thoughts are welcome.
P.S. I am using ASP.NET 3.5, web sites are hosted under Windows 2008
You need to host your images, CSS and scripts (more generally, whatever is loaded from the webpage) on your HTTPS site too to avoid mixed-content.
Depending on the level of security and isolation you could set up a shared virtual directory for the two websites that point to the same physical location.
Example, create a directory at C:\inetpub\shared-static and create a virtual directory /static under each website pointing to C:\inetpub\shared-static. From there both websites can refer to the image like ~/static/logo.png as necessary for shared content. When the directory has a new file (or replaced file) placed in it, both websites will refer to the same file.
If you can enable support of https on the main web site, you could use https for the image urls instead of http.
Alternative as others have suggested is to sync images / or used a shared location when serving them.
I see workaround:
on the 2nd web-site implement functionality that will check (once per day or per hour) if own images are the latest and update them when necessary...
That is a some work, but with such solution web site will be easier to support.
If you see a better option, please let me know.
Thanks.

Resources