View Full Version : How to display cached pages instead of real time dynamic pages
ludachris
07-12-2009, 09:49 PM
I'm in the process of trying to speed up the server and was thinking about possibly making some of my custom pages less dynamic. I have some pages that are similar to the Memberlist feature - a listing of members based on criteria in their profile. These pages are fully dynamic and updated in real time. I was wondering how I'd go about making it so these types of pages are written to a static file every 24 hours via a cron job. How would you structure something like that in vbulletin?
There are a heap of ways you can do this.
You could create a cron script that populates a field in a database with the relevant HTML output of your pages and then you could make this script manageable via commands of refreshing in the code. This is basically how most CMS's work these days.
I'm still unconvinced that file-based serving is faster than simple database record serving. I could be wrong ...
If you still (must) do it the file way, you can do this via php file methods in your scripts.
Remember, the cron script only needs to point to the script which generates the code - you don't have to do it all in the cron script.
The site navigation only needs to reference the cached page address (file or script).
Remember to update your robots.txt to disallow access to the code generating scripts, or place these scripts outside your virtual host directories.
I have some pages that are similar to the Memberlist feature - a listing of members based on criteria in their profile. These pages are fully dynamic and updated in real time. I was wondering how I'd go about making it so these types of pages are written to a static file every 24 hours via a cron job. How would you structure something like that in vbulletin?
Create a php script that outputs a static html file. Run the php script from a cron job (Linux cron job) every 24 hours.
vBulletin® v3.8.12 by vBS, Copyright ©2000-2024, vBulletin Solutions Inc.