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-13-2008 03:04 AM
Multple crons at boot ertzman SCO 0 11-20-2007 10:24 AM
Crons executed multiple times. shorty UNIX for Dummies Questions & Answers 2 03-14-2007 12:05 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-12-2007
eightgames eightgames is offline
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.
  #2 (permalink)  
Old 10-12-2007
reborg's Avatar
reborg reborg is offline Forum Staff  
Administrator
  
 

Join Date: Mar 2005
Location: Ireland
Posts: 4,245
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.
  #3 (permalink)  
Old 10-12-2007
eightgames eightgames is offline
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.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:52 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0