Filed under: web-design
With a synchronous web of data being the norm in this day and age it is no longer good enough to update a website on a per request basis. Users expect the content and data on a website to be relevant and readily available and whereas daily and less regular updates would have been acceptable a few years ago users are now expecting relevant content to be made available by the hour, if not by the minute. However there is clearly a considerable overhead in processing data for display on-the-fly as requested by your visiting public.
For anyone running their own data-driven site this would traditionally be achieved through running a cron job – a task scheduled to be performed on a regular basis on a server irrespective of whether that site is being visited or not. However, running cron jobs feature two complexities:
So what about a compromise – scheduling visits to your site to take place periodically rather than scheduling the server to perform task at regular intervals?
This was something I set about figuring out when I realised that a technology already existed which periodically checks a website: RSS. If we can set up an RSS feed to process a script as it is requested could we harness the power of RSS to semi-automate updates on your website? Hell yeah!
Setting up a test script on a server, I created an empty RSS feed and then subscribed to the feed using Google Reader. Everytime the feed was requested the time was logged in a separate text file. Like clockwork it transpires Google Reader (other feed readers are available boys and girls) was requesting the feed every three hours on the dot. So it might freak out if more complex scripts are attempted but in principal this might prove one way of scheduling relatively simple scripts to run on your server with relative frequency if you don’t have access to running cron jobs on your server.
Commenting is closed for this article.
John – Mar 26, 02:48 PM
Dan Griffey – Mar 26, 02:49 PM
Jason Cale – Mar 26, 02:55 PM
Cole – Mar 26, 03:00 PM
Cole – Mar 26, 03:07 PM
Jason Cale – Mar 26, 03:24 PM