Forum Discussion

Ryan_78003's avatar
Ryan_78003
Icon for Nimbostratus rankNimbostratus
Jul 28, 2010

Redirecting to Mobile Sites occasional failure

The situation:

 

I need to redirect mobile devices to mobile versions of sites. The catch is not all sites have mobile versions. In the iRule I regex to determine if the client is a mobile device, then to determine if a site has a mobile version I issue a GET that returns the url of the mobile site. Then I either continue on to the site or redirect to the mobile version of the site.

 

 

It seems that 2-3% of the time the iRule just silently dies and fails to issue the GET to lookup the mobile site. The rest of the time things work as expected.

 

 

Has anyone seen this kind of iRule behavior? Any thoughts on how to solve the issue?

 

6 Replies

  • Why not juse use a data group of all the sites that do have mobile versions? Then, if user agent is a phone and HTTP::uri eq datagroup, send the redirect?
  • Well there are quite a few sites, and new ones may be added daily. Manually updating the datagroup is not feasible.
  • So you're basically doing the following:

     

     

    1. Checking for mobile user agent.

     

    2. Issuing an HTTP GET from F5 for [HTTP::host]/mobile for example.

     

    3. If that get is successful, redirect them?

     

    4. If the get isn't successful, send them through to the default VIP behavior?

     

  • Basically yes. There is other logic that it does to see if the site is even has a possibility of a mobile site, that is checked against a data source as its small static data.

     

     

    And about 2-3% of the time the iRule mysteriously dies with no errors before the GET is processed. Its not a site specific thing either, if I do 30-50 requests for the same site back to back I will usually see at least one redirection failure.
  • Posted By Ryan on 07/28/2010 10:59 AM

     

    Basically yes. There is other logic that it does to see if the site is even has a possibility of a mobile site, that is checked against a data source as its small static data.

     

     

    And about 2-3% of the time the iRule mysteriously dies with no errors before the GET is processed. Its not a site specific thing either, if I do 30-50 requests for the same site back to back I will usually see at least one redirection failure.

     

     

    Are you logging with the iRule as well? If you can run 50, I'd say log everytime the redirect is or isn't issued and look at your results.
  • Can you post the (sanitized) iRule? It might help us provide recommendations on the issue.

     

     

    Aaron