Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: pulling content from db - is it a good idea?

by Abigail-II (Bishop)
on Nov 25, 2003 at 13:02 UTC ( [id://309880]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: pulling content from db - is it a good idea?
in thread pulling content from db - is it a good idea?

Members online is some information that doesn't look like it depends on the request being done. Often, for web pages, "members online" isn't anymore more than "this many members accessed the site in the last X minutes". If X is say, 2 minutes, and your site is very active, you might consider updating your index page every 2 minutes (if your site isn't very active, updating every 2 minutes doesn't hurt).

Unless it's about pages whose content isn't known until the request is made, I wouldn't dismiss static pages to quickly.

Abigail

  • Comment on Re: pulling content from db - is it a good idea?

Replies are listed 'Best First'.
Re: Re: pulling content from db - is it a good idea?
by jdtoronto (Prior) on Nov 25, 2003 at 15:30 UTC
    Spot on Abigail-II!

    It is very easy to fall into the trap of serving up everything dynamically. I did that a few projects back and had to do some major re-writing as the site became popular. From serving 100% of the site dynamically it i snow served about 95% statically. But all of the static pages are dynamically created.

    When a user modifies their HTML which is only part of the page, I generate a new static page and store it. It reduces the load on the server drastically. I even have some calendars - instead of generating them each time they are called I generate a static one as an HTML fragment and include it in pseudo-static pages using HTML::Template. At midnight UTC each day I generate about 120 new static pages for the following day, it takes less than 10 seconds to do! The slowest part of the whole operation is replacing the actual files.

    jdtoronto

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://309880]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-25 19:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found