Thursday, March 15, 2012

web2py app runs very slow via VPN (SOLVED)

My application works super fast when I connected in LAN but it takes about 60 sec every time the page is refreshed via VPN. This is so strange....



After a few hours of investigation, I found in the layout.html, it's trying to connect js and css files on the internet which is impossible to connect via VPN ! So my app keeps trying to connect the files over and over about 60 sec and finally gave up.

Version 1.99.4 (By default, it was NOT commented out)


    <!-- uncomment here to load jquery-ui -->
   
    <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
    <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
   
   <!-- uncomment to load jquery-ui -->


Versioon 1.99.4 (By default, it's commented out !! Yeah !)


 <!-- uncomment here to load jquery-ui
  <link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" type="text/css" media="all" />
  <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js" type="text/javascript"></script>
  uncomment to load jquery-ui //-->

TIPS for VPN
If you want to use the js and css files and your app may be connected by VPN, you should download the files and placed to local such as under "static/js" and "static/css".

No comments:

Post a Comment