Apache-Wyrd
view release on metacpan or search on metacpan
0.95 April 30, 2007
Module cleanup: removed some example & undocumented Wyrds from
the core distribution: CSSGene, Site:EditablePage,
Site::SearchResults, Site::WidgetControl. Added missing Version
Wyrd. Consolidated Lattice Wyrds into single file
Added View Wyrd for displaying contents of enclosing Wyrds
Added a FileCacheTimeout to Apache::Wyrd::Services::FileCache
Apache::Wyrd::Redirect can now use "href" conventions. New
normalize_href Apache::Wyrd::Services::SAK function for this
Apache::Form & Apache::Wyrd::Input has more passthrough of valid
attributes for their base tags (enctype, onkeydown, etc.)
Wyrds now accept hyphen in the attribute-name as a valid
character, to allow for compatibility with valid HTML
attributes such as "accept-charset"
Wyrd/Services/FileCache.pm view on Meta::CPAN
perl environment persists under mod_perl, the cache persists with it.
For areas where changes are very frequent (such as during development),
the caching behavior can be turned off within the apache config by
setting C<NoFileCache> to a true value:
PerlSetVar NoFileCache 1
The time between checks is also confiruable using a PerlSetVar directive:
PerlSetVar FileCacheTimeout x
Where x is a number of seconds.
=head1 FLAGS
=over
=item allow_nonexistent_files
Do not report a fatal error if the file can't be found. Instead, return
Wyrd/Services/FileCache.pm view on Meta::CPAN
sub get_cached {
my ($self, $file) = @_;
my $time = time;
my @stats = (undef,undef,undef,undef,undef,undef,undef,undef,undef,$_file_timestamp_register{$file});
my $new_timeout = 0;
my $force_load = 0;
if ($self->can('dbl')) {#we're in a Wyrd, so we can check the dir_config;
if ($self->dbl->req->dir_config('NoFileCache')) {
$force_load = 1;
}
$new_timeout = $self->dbl->req->dir_config('FileCacheTimeout')
}
#NB use or flip-flop for $new_timeout so that the dir-config value does not persist
#across different directory boundaries.
if ($force_load or ($_previous_checktime_register < ($time - ($new_timeout || $timeout)))) {
#$self->_info("checking $file against file cache");
@stats = stat($file);
delete($_file_cache_register{$file}) if ($stats[9] > $_file_timestamp_register{$file});
$_previous_checktime_register = $time;
}
return $_file_cache_register{$file} if (exists($_file_cache_register{$file}));
( run in 0.411 second using v1.01-cache-2.11-cpan-a5abf4f5562 )