The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
prolems figuring out dns nbredthauer UNIX for Advanced & Expert Users 1 04-12-2008 11:04 PM
Multple crons at boot ertzman SCO 0 11-20-2007 06:24 AM
Crons executed multiple times. shorty UNIX for Dummies Questions & Answers 2 03-14-2007 08:05 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-12-2007
Registered User
 

Join Date: Oct 2007
Posts: 2
Question Figuring out Crons

Hello,

I've built a news site using SimplePie to pull in a set of feeds and display them on a page. The caching is working but the problem is that the first initial load is slow. After that, you can hit refresh and it loads very quickly. I'd like to eliminate that first slow load by creating a cronjob, which is what I've heard many other people do. I'm very new to crons and programming in general so hopefully someone can help me understand this.

I found one example of a guy using the following cron to automatically visit his page and he syncronized the cache duration, thus eliminating any slow starts:

Code:
0,15,30,45 * * * * wget -q --spider http://thewebsite.com
The problem I found was that my host doesn't support wget (or lynx, or ssh) so I've been trying to write a cron that will achieve the same results but using either curl or php. Here is what I have so far:

Code:
*/15 * * * * curl --silent --compressed http://www.mysite.com/index.php
Code:
*/15 * * * * php /home/username/public_html/index.php
Again, I found these examples from reading other resources so I'm not entirely sure what they're doing or if they're correct for my situation. I've also set the cache duration to match at 15 minutes. When I run either the curl or php cron above, in my e-mail I receive the entire html source for the specified index.php. I'm assuming this means they're working correctly, but still my news page has that initial slow load. I'm open to any thoughts or ideas. Thanks in advance.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 10-12-2007
reborg's Avatar
Administrator
 
Join Date: Mar 2005
Location: Ireland
Posts: 3,513
If you run the php command like that you will bypass the webserver so it may not be cached, it depends what type of chache you are using.

You probably have the "ab" apache benckmarking tool, you can pass a URL to it and it will load the page through the webserver.
Reply With Quote
  #3 (permalink)  
Old 10-12-2007
Registered User
 

Join Date: Oct 2007
Posts: 2
Thanks for the fast response, Reborg.

I'm not sure what type of cache I'm using. Is there a quick way to find out? It's whatever is default when using SimplePie, because I haven't changed it.

Could you please describe how I might use the "ab" apache benckmarking tool? I have not heard of it before and would not know where to begin. If you could provide an example of how I would use that to pass the url through, I would really appreciate it. Again, thank you for the reply.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 12:01 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0