Migrating support.zeus.com

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:

  1. 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.

  2. 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.

  3. 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.

Owen Garrett [Zeus Dev Team] 24 January 2006  Permalink 2 comments  

Comments:

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.

Comment from: Mike [Visitor] · http://www.cheaperholidays.com/
Hello We need to set up rewrite rules in htccess so that http://www.cheaperholidays.com/holiday_guides.php?id=9 is made search engine friendly. Can you advse how to convert the apache code below to the Zeus equivelent. Options +FollowSymLinks RewriteEngine on RewriteRule holiday_guides-id-(.*)\.htm$ holiday_guides.php?id=$1 Thank you
Permalink 11 February 2006 @ 14:46
Comment from: Owen Garrett [Zeus Dev Team]

Hi Mike,

The following TrafficScript rule will do the trick:

$url = http.getPath();
if( string.regexMatch( $url, "^/holiday_guides-id-(.*)\\.htm$" ) ) {
   $newurl = "/holiday_guides.php?id=".string.escape( $1 );
   http.setPath( $newurl );
}

Here, we use a regular expression match to test if the incoming request looks like '/holiday_guides-id-foo.htm'. If it does, we extract the 'foo' bit into the $1 variable - this is done as a side effect of the regular expression match.

We then URL-escape the foo bit and set the URL to the new value (with 'id=foo').

So, external links (seen by a search engine) look like '/holiday_guides-id-foo.htm', but internal links (seen by your web application) look like '/holiday_guides.php?id=foo'.

Note - it you're using Zeus Web Server (not ZXTM), then you'll want to look at ZWS's Request Rewriting language. Head over to the ZWS support site and take a look at the Request Rewriting examples.

Permalink 14 February 2006 @ 11:22
Leave a comment ...
Your email address will not be displayed.
Your URL will be displayed.
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.
Options:
 
(Line breaks become <br />)
(Set cookies for name, email & url)
Download Free ZXTM Desktop Edition

Recent Articles

Other Resources



www.zeus.com