My main goal is to periodically poll a file hosted by a PaaS provider (Azure) to prevent it from becoming cold. It is a 600K+ pdf, so if I poll it once a minute, this could generate a significant amount of data (more than 20GB) per month.
The two methods I tried both perform full download of the data:
Invoke-WebRequest -Uri https://app.whatever.com/docs/staywarm.pdf((New-Object Net.WebClient).DownloadString('https://app.whatever.com/staywarm.pdf'))
I'd like to only get the first 1K, or even just the first 100 bytes. My theory that even that should keep that file warm.
I have the "Always on" turned on already. So it's interesting that the PDF still often takes 20 seconds to start downloading. The named PDF BTW is a Terms of Service PDF which has to be accepted by the user before login. So when it has to download the application itself should be warm already, since all the files (HTML, CSS, JS) related to the login page had to be served to the browser. So I thought that individual files like that big PDF can remain cold, although the app itself is warm?
You may turn on the
Always Onoption:It will prevent your app from being idled out due to inactivity
If you still want to use your way, you may just program to make your web app response a empty string to a specific path. For example: in .NET web application, you can directly response one OK action result for path '/check'.