title: Bypassing CloudFlare's time-out of 100 seconds
body: <p>I am attempting to AJAX-ify my reports in order to bypass the 100 seconds time-out that CloudFlare imposes on requests that run through its site.</p>
  
  <p>See <a href="https://stackoverflow.com/questions/38536167/is-it-possible-to-increase-cloudflare-time-out/44139506#44139506">Is it possible to increase CloudFlare time-out?</a></p>
  
  <p>I did the following:</p>
  
  <pre><code>function ajaxReport() {
      var seconds = prompt("Please enter how many seconds you want the report to run", "5");
      $('#imgWaiting').show();
      $.post("post/post_ajaxReport.jsp",
    {
      theParam:seconds
    },function(data) {
      $('#imgWaiting').hide();
      window.location=data;
   });
  
  }
  </code></pre>
  
  <p>and the following for post_ajaxReport.jsp</p>
  
  <pre><code>&lt;%
   int theParam=myFunctionToConvertStringToInt(request.getParameter("theParam"));
  int a=theParam/60;
  int b=theParam-a*60;
  String query="WAITFOR DELAY '00:"+a+":"+b+"';";
  double d=myCustomCodeToRunQuery(query);
  String fileName=createReport();
  %&gt;
  &lt;%=fileName%&gt;
  </code></pre>
  
  <p>The code worked great for under 100 seconds. But did not work for over 100 seconds.</p>
  
  <p>Any ideas?</p>
  
  <p><strong>UPDATE AFTER FEEDBACK</strong></p>
  
  <p>My reports work fine now without AJAX (although there is the 100 second time-out with CloudFlare). I was trying to convert them to AJAX in order to avoid grey-clouding a subdomain because I didn't want to expose my IP address. If I was going to grey-cloud a subdomain I would do it on the original code, which would be much simpler than AJAX-ifying my code! My question is "how to fix my AJAX code so that I would have the benefits of avoiding the 100 second timeout, but without the disadvantage of exposing my IP address..." </p>