Webcron: Difference between revisions

Content deleted Content added
Line 18:
 
=== Visitor Based ===
A webcron solution can be contained entirely on a web host by letting visitors trigger a webcron scheduler script on the server. For instance, this can be accomplished by using an [[img (HTML element)|'img' HTML element]] in the header or footer of the website, an [[ajax]] call in a script or an [[iframe]]. When a visitor views the website, the image loads, which triggers the webcron scheduler. The webcron scheduler runs any tasks that need to run and then outputs an image so the visitor's web browser does not display a broken image on the page.<ref name="phpJobSched" />{{psc|date=December 2010}} It may alternatively start the task [[asynchronously|Non-blocking_algorithm]] such that the [[http]] response is not delayed.
 
 
If there are insufficient visitors to a website using visitor based webcron scheduling, then scheduled tasks will not run on time.
 
 
Since visitor based webcron scheduling enables the possibility of self-contained webcron solutions, it increases the portability of a website or web-based software product. Some web-based [[open-source software]] that have tasks that need to run regularly use a visitor based webcron solution to execute those tasks.{{citation needed|date=December 2010}}