Wednesday, June 11, 2014

Adding random number to your cronjob URL

Update on Aug 22, 2014: Adding two more keywords: __account__ and __cronjob__. This feature is now supported in both URL and POST data (click Edit cronjob > More options > select HTTP Method: POST or PUT).

To prevent your web server from caching your cron script result, you can now add these keywords into your URL and POST data, and it'll automatically be replaced with a number when your cronjob is executed:

__random__ will be replaced with a random number
__timestamp__ will be replaced with the current Unix timestamp
__account__ will be replaced with your SetCronJob account ID
__cronjob__ will be replaced with your cronjob ID
(You can suggest more keywords by contacting me.)

For example, you can add it into your cronjob URL like this:

Each time your cronjob is executed, SetCronJob will replace that keyword with a random number, for example:

If you have any question or need any help, feel free to contact me or leave a comment below.

No comments:

Post a Comment