Speeding up website

I am not a IT Certified guy, so please excuse my mistakes.

For speeding up WordPress blog you need not to be a IT Guru because we are not going to write codes, only need knowledge and rights for installing software and some straight habit of reading documents is enough.

So how exactly we are going to increase speed of our blog and why we need CirruxCache and GAE, the answer is CDN. Typically our websites are hosted on a single web server with a very few mirror web servers at different locations but mostly mirror servers are used as a backup solution. In case of CDN it have many more servers situated around earth probably one in your city, CDN is a cache server it makes copy’s of website’s static contents and CirruxCache is a Python application used to Automatically cache static contents of our site to Google App engine to use as CDN server. NOTE:Google App Engine is not a CDN server but we are going to use it as CDN because of its speed and Cloud based System.

When someone visit our website in case single web server visitors computer request/loads all website contents from our central web server and if distance between visitor and server is far across oceans then digital data need to travel through the submarine cables with lots of routes resulting delay in website content loading.

With the help of CDN, website speed can be improved because CDN server are almost every where, if website content is cashed in CDN server then website visitors will serve by nearest CDN server, because of nearby server data need to travel few routs resulting fast web content loads. For comparison, from my location for visiting aadityas.com data need to travel from 23 routes and for cdn.aadityas.com (my CDN host) only 11 routs across with low delay in ms.

There are specialized CDN service providers but we are going to use Google’s GAE as our CDN server because we know how fast there systems are plus its free with some limits. and CirruxCache is OpenSource so again need not to pay if wish then can make a donations.

So What we need ?

1) Working self-hosted WordPress blog (not tested with blog hosted on wordpress.com)
2) CDN Linker plugin (newbie get CDN Linker lite)
3) Gmail account (required to signup for GAE)
4) Softwares – Python, Google App Engine SDK, CirruxCache

now steps as follows –

1) goto http://code.google.com/appengine/ and signup
2) create application
Applicaion name, its full url, Gmail account used to signup with GAE all this info will require timely so keep it with you till setup.
3) Download and install latest Python from http://python.org/download/releases/
4) Download and install Google App Engine SDK from http://code.google.com/appengine/downloads.html
5) Download and extract http://code.google.com/p/cirruxcache/downloads/list
6) Browse in extracted folder and open file named app.yaml look for application: appname replace appname with your appname then save and close file (only application name NO FULL URL).

application: xyz

7) now open file named config.py look below line saying # EDIT BELOW default lines are

urls[‘default’] = (
#'(/debug/.*)’, ‘Debug’,
‘(/data/.*)’, ‘config.Static’,
‘/www(/.*)’, ‘config.Www’
)

class Static(cache.Service):
origin = ‘http://static.mydomain.tld’
maxTTL = 2592000 # 1 month
ignoreQueryString = True

class Www(cache.Service):
origin = ‘http://www.mydomain.tld’
allowFlushFrom = [‘127.0.0.1’]
forceTTL = 3600 # 1 hour
ignoreQueryString = True
forwardPost = False

Change them according to your needs, for example.

urls[‘default’] = (
‘/_cron/(.*)’, ‘Cron’,
‘(/wp-includes/.*)’, ‘config.Static’,
‘(/wp-content/.*)’, ‘config.Static’
)

class Static(cache.Service):
origin = ‘https://aadityas.com’
maxTTL = 2592000 # 1 month
ignoreQueryString = True
forwardPost = False
allowFlushFrom = [‘127.0.0.1’]

In above example ‘/_cron/(.*)’, ‘Cron’, calls a cron (cron is a Scheduled Tasks) config stored in cron.yaml it helps to keep our Datastore clean, lines ‘(/wp-includes/.*)’, ‘config.Static’ and ‘(/wp-content/.*)’, ‘config.Static’ are typical static sub-folders of WordPress blog the format is ‘(/folder name/every thing inside folder)’, ‘config.class name’, and the next para is a Class telling the base url of your domain next maximum cache time, ignoreQueryString tells whether ignore queries or not (Say …wp-admin/post.php?post=280, Prefer to keep it True), forwardPost tell wheter use forwarding or redirecting POST requests, allowFlushFrom = [‘127.0.0.1’] requires for error free Cron operations.

Confused ? dont worry open config.py delete everything below # EDIT BELOW line then copy paste example lines below # EDIT BELOW and replace https://aadityas.com with your domain name then save and close file.

Remember it is a coding a little bit mistake will stop your program, look closely at url para in given example you will notice between brackets there are three lines present two lines have comma at the end but last line have no comma, so in case you add your custom paths remember all lines expect last line should have a comma sign at end of line.

Its time to test and upload Cirruxcache with custom settings to GAE, Launch Google app engine Launcher (its in your start menu) Go to Edit-Prefrences… enter/select the path for file name python.exe in my case its C:\Python27\python.exe hit OK, Go to File-Add Existing Application… browse to CirruxCache directory hit Add, now select app then click on Run, wait till Stop and Browse button activates then click on Browse button a default browser will be up and in page area you will see something like CirruxCache (0.4.2) / http://code.google.com/p/cirruxcache/ if you see invalid syntax or sees nothing then on Google App Engine Launcher hit Stop button then recheck your config.py file correct and save, After you see text like CirruxCache (0.4.2) / http://code.google.com/p/cirruxcache/ Browse your WordPress blog copy any image url say http://xyz.com/wp-content/uploads/memyself.jpeg and replace its domain name with http://localhost:8080/ so it will look a like http://localhost:8080/wp-content/uploads/memyself.jpeg then hit enter Your image should load if not Stop-Recheck Config.py-Run-Test url so on. if it loads then you are ready to upload CirruxCache for that Stop the app Click on Deploy enter full email address (used to signup with GAE) enter password hit ok, upon successful upload close Google App Engine Launcher.

Login to WordPress install and activate CDN Linker Lite Or CDN Linker plugin configure it to point at appengine application Say yoursitecdn.appspot.com (its Full application url) Save Changes.

And now your WordPress blog is using CDN, to verify CDN is working are not surf your blog and look at its source codes right click on page and select view source (or similar menu) read code you will notice that your css js scripts jpg png etc kind of images any kind of small videos overall all static site contents URL is different from your site url it will look something like http://xyz.appspot.com/wp-content/uploads/memyself.jpeg before CDN it use to be http://xyz.com/wp-content/uploads/memyself.jpeg.

For further speed increase try plugins like DB Cache, HyperCache.

This method will reduce server load, save bandwidth, and increase page ranks.

CirruxCache can be used with websites other than WordPress for details visit Official Guide about CirruxCache

Aditya Sawant © 2010-2017 | Google + | Author | Store | LinkedIN