Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Another option- Partially live. Use the excellent Cache::Cache to cache your output from HTML::Template, and then feed that to your users. Something like:

my $cache=Cache::FileCache->new(); #options here. . . my $cache_key=$id; #Cache key that uniquely identifies this page my $object=$cache->get($cache_key); my $output; if( not defined $object){ # The page isn't in the cache, or it's expired. # Create your page, piping it through HTML::Template. $cache->set($cache_key,$object,'2 hours'); } else { # The page is in the cache. $output=$object; } print $object;

The cool thing about this is you can delete the page directly from the cache when it's updated, so you can set your expire times pretty long. In this example I'm caching the entire page, but you can (obviously) only cache the very expensive parts of your application, or NOT cache the parts you want to change on each instance.

I like Cache::Cache a LOT, but you really need to benchmark to make sure you're saving time.

-Any sufficiently advanced technology is
indistinguishable from doubletalk.


In reply to Re: Database driven web content: live or tape? by Hero Zzyzzx
in thread Database driven web content: live or tape? by talexb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-16 16:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found