Bypassing CloudFlare's time-out of 100 seconds

后端 未结 2 2117
心在旅途
心在旅途 2021-02-10 03:43

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.

See Is it possible to i

2条回答
  •  旧巷少年郎
    2021-02-10 04:09

    Since cloudflare does not cache html or xhr, you can greycloud a subdomain but on the server use that as an alias. For example...

    In CloudFlare dns:

    • www 123.123.123.123 = orange (protected)
    • ajax 123.123.123.123 = grey (dns only)

    In your website control panel add ajax.mydomain.com as an alias.

    Finally, in your code use the fqdn that hits your server bypassing cloudflare.

    function ajaxReport() {
        var seconds = prompt("Please enter how many seconds you want the report to run", "5");
        $('#imgWaiting').show();
        $.post("//ajax.mydomain.com/post/post_ajaxReport.jsp",
      {
        theParam:seconds
      },function(data) {
        $('#imgWaiting').hide();
        window.location=data;
     });
    }
    

    This does expose your IP address. But there should be little to no performance penalty, depending on the content returned.

提交回复
热议问题