You may have noticed that we recently updated the support.zeus.com website. A lot of content was moved, we are using Google Analytics to track visitors, we gather recent news headlines for the front page, and we improve the performance of the site using content caching.
This article discusses the various ZXTM features that we employed to make rolling the new website out much easier.
The requirements
When we rolled out the new support.zeus.com site, we had a number of requirements in mind that ZXTM was able to resolve:
-
Much of the content was re-organized and moved, meaning that existing bookmarks, referring links and search engine results would fail. We wanted to ensure that attempts to access the old content would be redirected in an intelligent way.
-
We wanted to track users to the support and knowledgehub sites using Google Analytics. This involved inserting a common fragment of JavaScript code into every web page.
-
We wanted a central 'landing page' from which visitors could access the support information for each product. The landing page was to include the most recent news articles relevant to each product.
Maintaining existing links to support.zeus.com
The following TrafficScript request rule was used to catch old links to content that had been moved, redirecting the visitor to the most appropriate section of the new website:
if( http.getHeader( "Host" ) != "support.zeus.com" ) break;
$url = http.getPath();
# Known good URLs
if( string.startsWith( $url, "/zws" ) ||
string.startsWith( $url, "/zlb" ) ||
string.startsWith( $url, "/img" ) ||
string.startsWith( $url, "/misc" ) ) break;
# Redirects
if( string.startsWith( $url, "/faq/zlb" ) )
http.redirect( "/zlb/faqs/" );
if( string.startsWith( $url, "/faq/zws" ) )
http.redirect( "/zws/faqs/" );
if( string.startsWith( $url, "/doc/zws" ) )
http.redirect( "/zws/docs/" );
if( string.startsWith( $url, "/doc/zlb" ) )
http.redirect( "/zlb/docs/" );
if( string.startsWith( $url, "/doc/examples" ) ||
string.startsWith( $url, "/doc/api" ) )
http.redirect( "/zws/examples/" );
if( string.startsWith( $url, "/tools" ) )
http.redirect( "/zws/tools/" );
if( string.startsWith( $url, "/products" ) )
http.redirect( "/zws/integration/" );
# Catch-almost-all
if( string.contains( $url, "/zws" ) ) http.redirect( "/zws/" );
if( string.contains( $url, "/zlb" ) ) http.redirect( "/zlb/" );
# Stuff like favicon.ico and robots.txt will get through, as will
# '/' and '/index.html'
This ensured that old bookmarks, referring links and search engine results were still valid, even though the content was no longer present at that location.
Tracking users using Google Analytics
To use Google Analytics, it's necessary to embed a fragment of JavaScript code in every web page. We could have done this by modifying each template that we used to generate the web content, but it was much easier to use a TrafficScript rule to insert the code on every response.
The KnowledgeHub article Using Google Analytics on your web site - the easy way! described how we achieved this.
Embedding recent news stories on the landing page
Each product's support site publishes recent news stories in the form of RSS feeds. We also publish recent company news from www.zeus.com in much the same way. We wanted to include some of these news stories on the landing page support.zeus.com/index.html.
Obviously, each time a news story is published on any of these sources, we do not want to have to rebuild the landing page, so we chose to use a TrafficScript rule to do so for us. The KnowledgeHub article Embedding RSS data using a TrafficScript rule describes how to do this.
Improving performance
We embedded the RSS data using several custom RSS tags that ZXTM intercepted and replaced:
<!RSS http://www.zeus.com/news/rss.xml !>
<!RSS http://knowledgehub.zeus.com/xmlsrv/rss2.php?theblog=news !>
<!RSS http://support.zeus.com/zws/xmlsrv/rss2.php?theblog=news !>
<!RSS http://support.zeus.com/zlb/xmlsrv/rss2.php?theblog=news !>
Each RSS tag was processed in turn - the TrafficScript rule would retrieve the RSS data and apply an XSLT transform to format the data correctly. Because the RSS data was generated on-the-fly, this caused a considerable slowdown for the landing page - from less than 20ms download time over a local network to approximately 1.5 seconds. This is because the three knowledgehub and support RSS feeds each took about 0.5 seconds to generate.
We enabled ZXTM's content caching for the document, and set the cache time to 120 seconds using the following snippet of TrafficScript:
http.addResponseHeader( "Cache-Control", "max-age=120" );
This ensured that the page was updated at most once every 120 seconds, and all other times it was served immediately from ZXTM's local cache.
This public messageboard is not a forum for technical support. To report technical support problems, please contact our dedicated Support team using the instructions at the bottom of this page.