Jump to content


Photo

cache a php page as html


  • Please log in to reply
2 replies to this topic

#1 n8w

n8w
  • Members
  • PipPipPip
  • Advanced Member
  • 123 posts

Posted 18 September 2006 - 07:51 PM

I was wondering if there is a good way where I could run a cron-tab every 5 minutes to run a php script to save a php page as static html?

for example .. I would like to run a script that would save http://www.illustrat...o.com/index.php as http://www.illustrat....com/index.html exactly how the php page is displayed

the reason I want to do this is to reduce connections to mysql

thanks
n8w



#2 obsidian

obsidian
  • Staff Alumni
  • Advanced Member
  • 3,202 posts
  • LocationSeattle, WA

Posted 18 September 2006 - 07:54 PM

check out screen scraping. basically, you'd want to run a screen scrape of the page in your cron job and simply update the HTML page you're displaying with each scraping. there are several good, free classes out there to help you with this.
You can't win, you can't lose, you can't break even... you can't even get out of the game.

<?php
while (count($life->getQuestions()) > 0)
{   $life->study(); } ?>
  LINKS: PHP: Manual MySQL: Manual PostgreSQL: Manual (X)HTML: Validate It! CSS: A List Apart | IE bug fixes | Zen Garden | Validate It! JavaScript: Reference Cards RegEx: Everything RegEx

#3 n8w

n8w
  • Members
  • PipPipPip
  • Advanced Member
  • 123 posts

Posted 18 September 2006 - 08:09 PM

very cool!!!!!
thanks




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users