Part of the EllisLab Network
pMachine Pro has been replaced by ExpressionEngine, our full featured web publishing solution. Please consider upgrading.
You can download pMachine Pro here: Download pMachine Pro  |  Download Language Packs
   
 
A Simple Dynamic Index Cache for pMachine 2.4
Posted: 24 February 2006 02:57 PM   [ Ignore ]  
Summer Student
Total Posts:  26
Joined  2005-12-31

1) Verify that the RSS factory is correctly enabled and index.xml has 666 permissions.

2) Install the cache per the original instructions provided with the program.

3) Modify the new “index.php to add this code before the test statement:

if ($cache == 1)

New code:

$xmltime = filemtime("index.xml"); // Change this if you are using a name other than index.xml for RSS

$cachedtime = filemtime("cache_time.txt"); // this could also be cache_file.php, but it can be very large file

if($xmltime > $cachedtime) $cache = 1;

Every time you add an entry to the blog, the index cache will be updated.

NOTE: I set $time = 600; in my index.php (10 hours), if you have other considerations you might want to set it to a smaller value.

If I discover issues or enhancements, I will post.

NOTE: For some reason you must do a dummy post to get the cycle started.

I have very limited experience and knowledge of PHP, if there is a PHP person that would volunteer to help with this scheme it would be much appreciated.  It needs some tuning, etc to make more efficient and to verify success of the cache file.

I come from an Assembler, C and Turbo Pascal background, so I can follow some aspects, but serious details are beyond me.

Profile
 
 
Posted: 06 March 2006 07:45 PM   [ Ignore ]   [ # 1 ]  
Summer Student
Total Posts:  26
Joined  2005-12-31

An update…

After if ($cache == 1) insert this code before “// Start output buffer”

// New way 3-6-06
$f = fopen($timefile, “w+");
fputs($f, time());
fclose($f);

So the cache reference time is adjusted whenever cache == 1

Learn something every day :=)

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 233, on December 18, 2007 12:04 AM
Total Registered Members: 58789 Total Logged-in Users: 0
Total Topics: 69482 Total Anonymous Users: 0
Total Replies: 374078 Total Guests: 36
Total Posts: 443560    
Members ( View Memberlist )
Active Members: