开发者

how to keep external nopcommerce website alive in IIS using cron job

I have a NopCommerce website on a limited "shared" hosting (no acces开发者_Python百科s to the IIS/server settings) and it has a /keepalive/Ping.ashx that executes every 60 seconds to return "Ping" string

I need this to keep IIS from removing the site from its memory/cache/cycle/pool if there is no traffic. How can i know whether that script is running?

Do i have to do the same using a php cron. is it possible? and how?

Please let me know Thanks


Assuming that the ping string means that the server is OK you just need to create a script that runs under cron, Windows Task Scheduler etc to request the ping.ashx url. You could write this in a programming language like PHP but it might be easier to do it with some command line tools. Either way it is a simple bit of code.

Off the top of my head you can do something like this on Linux to pull down and match the string. You'll need to modify if you need to match on something other than Ping in case it returns an error message:

curl http://site/keepalive/ping.ashx | grep "Ping"

If you provide information on what types of scripts you can run on your hosting I can provide more help. If you have a control panel for the shared hosting you might find a builtin task scheduler you can use.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜