vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to display cached pages instead of real time dynamic pages (https://vborg.vbsupport.ru/showthread.php?t=218465)

ludachris 07-12-2009 09:49 PM

How to display cached pages instead of real time dynamic pages
 
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?

ranz 07-13-2009 01:14 AM

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.

Andy 07-13-2009 01:27 AM

Quote:

Originally Posted by ludachris (Post 1847704)
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.


All times are GMT. The time now is 02:44 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01250 seconds
  • Memory Usage 1,712KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete