Problem
When trying to access and purchase a specific item from store X, which releases limited quantities randomly throughout the week, trying to load the page via the browser is essentially pointless. 99 out of 100 requests time out. By the time 1 page loads, the stock is sold out.
Question
What would be the fastest way to load these pages from a website -- one that is currently under high amounts of stress and timing out regularly -- programmatically, or even via the browser?
For example, is it better to send multiple requests and wait until a "timed out" response is received? Is it best to retry the request after X seconds has passed regardless? Etc, etc.
Tried
I've tried both solutions above in browser without much luck, so I'm thinking of putting together a python or javascript solution in order to better my chances, but couldn't find an answer to my question via Google.
EDIT:
Just to clarify, the website in question doesn't sporadically time out -- it is strictly when new stock is released and the website is bombarded with visitors. Once stock is bought up, the site returns to normal. New stock releases last anywhere from 5 minutes to 25 minutes.
There can be so many reasons why you are getting so many request timeouts from the server. It may be from your client application or from the server application settings (to reduce unfavorable request behaviours from certain clients) or a simple DNS resolution taking too long. One thing that is sure though is that bugging the server with so many requests at a time will definitely not guarantee you less timeouts, but may aggravate the situation.
One way you can solve the problem (if you don't have control of the server side) is to monitor the server application behaviour from your end for at least a day or two. A simple script that sends test requests at regular intervals might do the trick. You can measure parameters like request resolution time, frequency of failed requests, and type (cause) of failure (if that is deducible). These parameters can be measured over a given period of time (a day or two) to know statistically when it is more favourable to make request to the server. This "profiling" of the server may not always be accurate but can be done regularly with better thought out parameters to get better results. BTW... Enough data may even benefit from some AI data analytics :).
Best way to increase odds of connecting to a server that is temporarily timing out due to an influx of visitors?