Technology + People + Process

Kentico CMS Utility for Improved Site Performance - By Sathish Potta
Feb 03
2015

Kentico CMS Utility for Improved Site Performance - By Sathish Potta

Kentico CMS Utility for Improved Site Performance - By Sathish Potta

You may have noticed that when a Kentico site is deployed on to a server, when we browse the site pages for the first time, it takes much time to load the pages. Once it is cached at server side, then the performance of pages improves.

 

 

Solution

The solution to avoid the above problem would be; if we can visit all the pages with-in the site then server side cache will be generated and performance of the pages will improve. If we have only a few number of pages we can do it easily. But, if we have large number of pages then visiting all the pages may become a difficult task for the client. In order to avoid this kind of problems we need to automate the visiting of all pages using a program/tool.

We have created a CMSUtility program/tool to visit all the pages with-in the site using casperJS.

CasperJS is an open source navigation scripting & testing utility written in Javascript for the PhantomJS WebKit headless browser and SlimerJS (Gecko). It eases the process of defining a full navigation scenario and provides useful high-level functions, methods & syntactic sugar for doing common tasks such as:

  • Defining & ordering browsing navigation steps
  • Filling & submitting forms
  • Clicking & following links
  • Capturing screenshots of a page (or part of it)
  • Testing remote DOM
  • Logging events
  • Downloading resources, including binary ones
  • Writing functional test suites, saving results as JUnit XML
  • Scraping Web contents

Design:

  • Use casperJS to read the sitemap.xml of the site. casperJS runs on the PhantomJS environment.
  • For each page listed in the sitemap.xml, do a GET request for the page.
  • This will make the server cache the page for faster response for subsequent requests.
  • The tool will maintain a log for all the pages with-in the site.
  • The tool would maintain a log of the pages visited and its status including reponse time, in the local directory where the tool is run from. Example: www.raybiztech.com/blog
  • For the first time it took 10.54s to load the page.
  • We've browsed the site and it cached at server side. After server side caching it took 4.31s to load the page.
  • After browser caching it took 1.26s to load the page to load the page.
  • After Running Utility tool/program it took 4.32s.
  • After browser caching it took 824ms to load the site.

Request for Quote

Drop us a line and we'll get in touch with you as quick as we can