Example: If the first request took about 1.32s, the subsequent requests will take approx 1.18s to 1.2s.
From my research, the first request can be improve by setting the StartServers
, MinSpareThreads
and MaxSpareThreads
in the apache\conf\extra\httpd-mpm.conf
However, there is no guidelines mention that what numbers can really help to increase the first request speed.
Also, some advise that to have a page at the server that keep refreshing on the webpage using the following script:
<html>
<head>
<script>
setTimeout(function(){
window.location.reload(1);
}, 2000);
</script>
</head>
<body>
<iframe name="iframe" id="iframe" src="http://mywebsite:8080"></iframe>
</body>
</html>
This page although keep apache busy but it increase the apache log faster.
So, may I know what actions can I do so that I can have the first request to have the same response time or even faster response time than the subsequent request?
Below is the scenario of a first request and subsequent requests:
10:00:01 AM Access URL http://mywebsite.com (Response time: 1.32s - First Request)
10:00:07 AM Access URL http://mywebsite.com (Response time: 1.2s - 2nd Request)
10:00:37 AM Access URL http://mywebsite.com (Response time: 1.19s - 3rd Request)
10:01:07 AM Access URL http://mywebsite.com (Response time: 1.21s - 4th Request)
10:35:35 AM Access URL http://mywebsite.com (Response time: 1.35s - First Request)
10:35:48 AM Access URL http://mywebsite.com (Response time: 1.2s - 2nd Request)
10:51:08 AM Access URL http://mywebsite.com (Response time: 1.36s - First Request)
10:51:13 AM Access URL http://mywebsite.com (Response time: 1.2s - 2nd Request)
10:51:38 AM Access URL http://mywebsite.com (Response time: 1.19s - 3rd Request)
10:52:07 AM Access URL http://mywebsite.com (Response time: 1.23s - 4th Request)
Notice that after a short duration of inactivity, a first
request is made and the response time get delayed. However, a subsequent request made within a minute or so does not have that delay.
Thank you.