PassengerContact Page Slowdown

October 16th, 2011

Back in 2006 when I was developing a customized solution for SkyBus, I was alarmed at the time it took for SkySales to initialize itself when it reached the passenger / contact page. On further investigation, I found that the call to the ResourceCache to get a list of countries and states was the culprit.

Normally, once the SkySales retrieves this information from the reservation core, it’s cached for future calls. This is great unless you’re a developer who is constantly restarting the site. In that case, developers will experience the empty Country / State cache slow down more often than not.

The problem lies in how Navitaire has structured the retrieval of states. If you examine the GetStates method in the ResourcesCacheService class you’ll find that it’s performing a loop on each country in order to retrieve its states. This amounts to about 75+ calls to core, which individually would be quick, but when combined together they equal a bothersome slowdown.

One solution to this would be to override the resource cache with your own custom cache. You could then limit the amount of calls to, say, the US and Canada (where states are commonly used). However, this approach is problematic because you’d also have to override any controls that used the original resource cache as they are bound to the Navitaire version and not any custom version you provide.

For issues like this, I suggest that Navitaire make the resources cache an interface contract that can be overridden (most everything else now is interface-based in their 3.x framework anyway). However, for this specific issue, it definitely wouldn’t hurt for Navitaire to write a custom database call that brought back all countries and states in one shot, thus saving the repeated (unnecessary) round trips through core to the New Skies database.

Special note: Thanks to Greg from Spirit for helping track this annoyance down!


Trackback URI | Comments RSS

Leave a Reply

Name (required)

Email (required)

Website

Speak your mind