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

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

Serving Software Downloads in 976 Categories, Downloaded 29.547.243 Times

CGI::Cache 1.4200

  Date Added: January 18, 2010  |  Visits: 893

CGI::Cache

Report Broken Link
Printer Friendly Version


Product Homepage
Download (73 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
Games  -  Hoobie's Domino Adventure 1.2.1
Use the domino effect and help penguin Hoobie through his adventure! This will be quite tricky because with just one push all the dominoes must fall at once - are you up to the challenge? The little penguin Hoobie fell asleep on an ice flow...
47.3 MB  
Productivity  -  HF Unit Converter 1.0.0.0
This app can help user to convert the units that will be used in their daily life. It includes length, weight,area and temperature unit converter. The user-friendly user interface and useful unit converter will help user to convert units....
1024 KB  
Finance  -  Loan Calc Pro 1.0.0.1
Loan calculator will help you figure out what the repayments will be on your loan. You can also add extra repayments to see how much time and interest you could save. Calculate how much you can borrow based on how much you can afford to...
1024 KB  
Games  -  Little Fish Big Pond 1.1.0.0
You are a brave little fish in a vast ocean. Avoid bigger fish that don't have the best of intentions and get your gold treasure along the way. With a little extra help from some of your friends, you will be able to beat the high score!...
12 MB  
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  
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  
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  
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  
NEW DOWNLOADS IN PROGRAMMING, LIBRARIES
Programming  -  FLEX-db Digital Asset Manager 3.0.9
FLEX-db - an enterprise Digital Asset Manager (DAM). It ingests and links metadata with files, creates thumbnails, and processes files using business rules. FLEX-db has a JSP client, Java app server for file input and output and an EJB metadata...
21.57 MB  
Programming  -  Libicom 0.9.0
The libicom library is a character based dynamicly linked library for Linux. It is used to remotely control the Icom IC-R8500 wide band receiver via an RS232 link. All call and return parameters to the control functions are character string based....
20.48 KB  
Programming  -  dotdesktop 0.3
Dotdesktop library provides ability to parse desktop entry file and access the information in a convenient way. Desktop entry file format is defined by freedesktop.org, it is used to describe information about an application such as the name and...
327.68 KB  
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  -  libyasl 0.2
Libyasl is a C++ class library to easily realize TCP/UDP/Multicast clientsand servers in IPv4 and IPv6 environments under GNU/Linux systems.
143.36 KB  
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  
Libraries  -  App::SimpleScan::Substitution::Line 2.02
App::SimpleScan::Substitution::Line is a line with optional fixed variable values. SYNOPSIS my $line = App::SimpleScan::Substitution::Line->new(" this "); # Use only this value when substituting " ". $line->fix(substituite =>...
54.27 KB