Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 50.247.868 Times

CGI::Cache 1.4200

  Date Added: January 18, 2010  |  Visits: 1.355

CGI::Cache

Report Broken Link
Printer Friendly Version


Product Homepage
Download (93 downloads)



CGI::Cache is a Perl extension to help cache output of time-intensive CGI scripts. WARNING The interface as of version 1.01 has changed considerably and is NOT compatible with earlier versions. A smaller interface change also occurred in version 1.20. SYNOPSIS Heres a simple example: #!/usr/bin/perl use CGI; use CGI::Cache; # Set up cache CGI::Cache::setup(); my $cgi = new CGI; # CGI::Vars requires CGI version 2.50 or better CGI::Cache::set_key($cgi->Vars); # This should short-circuit the rest of the loop if a cache value is # already there CGI::Cache::start() or exit; print $cgi->header, "n"; print << EOF; < html >< body > < p > This prints to STDOUT, which will be cached. If the next visit is within 24 hours, the cached STDOUT will be served instead of executing this print. < /body >< /html > EOF Heres a more complex example: use CGI; use CGI::Cache; my $query = new CGI; # Set up a cache in /tmp/CGI_Cache/demo_cgi, with publicly # unreadable cache entries, a maximum size of 20 megabytes, # and a time-to-live of 6 hours. CGI::Cache::setup( { cache_options => { cache_root => /tmp/CGI_Cache, namespace => demo_cgi, directory_umask => 077, max_size => 20 * 1024 * 1024, default_expires_in => 6 hours, } } ); # CGI::Vars requires CGI version 2.50 or better CGI::Cache::set_key( $query->Vars ); CGI::Cache::invalidate_cache_entry() if $query->param( force_regenerate ) eq true; CGI::Cache::start() or exit; print "Content-type: text/htmlnn"; print << EOF; < html >< body > < p > This prints to STDOUT, which will be cached. If the next visit is within 6 hours, the cached STDOUT will be served instead of executing these prints. < /p > EOF CGI::Cache::pause(); print <<EOF; This is not cached. EOF CGI::Cache::continue(); print <<EOF; < /body >< /html > EOF # Optional unless youre using mod_perl for FastCGI CGI::Cache::stop(); This module is intended to be used in a CGI script that may benefit from caching its output. Some CGI scripts may take longer to execute because the data needed in order to construct the page may not be quickly computed. Such a script may need to query a remote database, or may rely on data that doesnt arrive in a timely fashion, or it may just be computationally intensive. Nonetheless, if you can afford the tradeoff of showing older, cached data vs. CGI execution time, then this module will perform that function. This module was written such that any existing CGI code could benefit from caching without really changing any of existing CGI code guts. The CGI script can do just what it has always done, that is, construct an html page and print it to the output file descriptor, then exit. What youll do in order to cache pages is include the module, specify some cache options and the cache key, and then call start() to begin caching output. Internally, the CGI::Cache module ties the output file descriptor (usually STDOUT) to an internal variable to which all output is saved. When the user calls stop() (or the END{} block of CGI::Cache is executed during script shutdown) the contents of the variable are inserted into the cache using the cache key the user specified earlier with set_key(). Once a page has been cached in this fashion, a subsequent visit to that page will invoke the start() function again, which will then check for an existing cache entry for the given key before continuing through the code. If the cache entry exists, then the cache entrys content is printed to the output filehandle (usually STDOUT) and a 0 is returned to indicate that cached output was used..

Requirements: No special requirements
Platforms: Linux
Keyword: Cache Cached Cgi Cgicache Help Libraries Output Perl Print Programming Stdout Will Be
Users rating: 0/10

License: Freeware Size: 44.03 KB
USER REVIEWS
More Reviews or Write Review


CGI::CACHE RELATED
Libraries  -  Jifty::Script::Help 0.60912
Jifty::Script::Help is a Perl module to show help. OPTIONS Optionally help can pipe through a pager, to make it easier to read the output if it is too long. For using this feature, please set environment variable PAGER to some pager program....
532.48 KB  
Libraries  -  CGI::Application::Generator 1.0
CGI::Application::Generator is a Perl module with dynamically build CGI::Application modules. SYNOPSIS use CGI::Application::Generator; # Required methods my $cat = CGI::Application::Generator->new();...
14.34 KB  
Utilities  -  Arbitrary Command Output Colourer 0.7.1
acoc is a regular-expression based colour formatter for programs that display output on the command-line. It works as a wrapper around the target program, executing it and capturing the stdout stream. Optionally, stderr can be redirected to...
40.96 KB  
Libraries  -  Embedix::ECD 0.09
Embedix::ECD is a Perl module with Embedix Component Descriptions as objects. SYNOPSIS instantiate from a file my $ecd = Embedix::ECD->newFromFile(busybox.ecd); my $other_ecd = Embedix::ECD->newFromFile(tinylogin.ecd); access nodes my...
40.96 KB  
Audio Tools  -  phpCDLabelPS 0.0.4
phpCDLabelPS creates labels for your data/MP3 CDs using PHP and PostScript (output will be a postscript file). It is controled by a frontend and a PostScript template. To install, just extract all files somewhere in your webtree. Then point your...
13.31 KB  
Libraries  -  GO::View 0.72
GO::View is a Perl module that creates a gif or png image for visualizing the GO DAG. This perl module generates a graphic that displays the parent and child relationships of a selected GO term. It also provides the visualization for the...
870.4 KB  
Libraries  -  Sys::OutPut 2.1
Sys::OutPut is a Perl module to help make output easier. SYNOPSIS usage Sys::OutPut; talk $fmtstr [, @args]; out $fmtstr [, @args]; put $fmtstr [, @args]; err $fmtstr [, @args]; debug $fmtstr [, @args]; $Sys::OutPut::quiet =...
10.24 KB  
Libraries  -  SVK::Command::Help 1.08
SVK::Command::Help is a Perl module to show help. OPTIONS Optionally svk helps can pipe through a pager, for it is easier to read if the output is too long. For using this feature, please set environment variable SVKPAGER to some pager...
266.24 KB  
Libraries  -  Cache::Memcached::Tie 0.03
Cache::Memcached::Tie is a Perl module created for using Cache::Memcached as hash. SYNOPSIS #!/usr/bin/perl -w use strict; use Cache::Memcached::Tie; my %hash; my $memd=tie %hash,Cache::Memcached::Tie, {servers=>[192.168.0.77:11211]};...
15.36 KB  
Libraries  -  CGI::WeT::Modules::Calendar 0.71
CGI::WeT::Modules::Calendar are Perl extensions to engine to allow calendar management. SYNOPSIS use CGI::WeT::Modules::Calendar (); This module provides rendering constructs to allow navigation through a set of calendars. Support is...
40.96 KB  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB  
Libraries  -  wolfSSL 4.0.0
The wolfSSL embedded SSL/TLS library is a lightweight SSL library written in ANSI standard C and targeted for embedded and RTOS environments - primarily because of its small size, speed, and feature set. It is commonly used in standard operating...
3.88 MB  
Libraries  -  EuGTK 4.8.9
Makes it easy to develop good- looking, fast, cross-platform programs that run on Linux, OS X, and Windows. Euphoria is a very fast interpreted/compiled language with straight-forward syntax. EuGTK allows programming in a clean, object-oriented...
10.68 MB  
Libraries  -  Linux User Group Library Manager 1.0
The LUG Library Manager is a project to help Linux User Groups start their own library. A LUG library is helpful to the community at large because it increases access to information, and gives everyone the opportunity to become more knowledgeable.
5.35 KB  
Libraries  -  Module::MakefilePL::Parse 0.12
Module::MakefilePL::Parse is a Perl module to parse required modules from Makefile.PL. SYNOPSIS use Module::MakefilePL::Parse; open $fh, Makefile.PL; $parser = Module::MakefilePL::Parse->new( join("", ) ); $info = $parser->required;...
8.19 KB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB