Rene Schickbauer

NAME

Maplat::Web::RootFiles - provide static files to browser

SYNOPSIS

This module provides RAM caching of static files. This special module registers some defined files directly in the root of the webpaths AND MARKS THEM PUBLIC.

DESCRIPTION

During the reload() calls, this modules recursively loads all files in the configured directory into RAM and delivers them to the browser very fast.

It also sets chache_control and expires header to further reduce the load on the server. For multiple base directories (for example images, sounds, ...) you can use this module multiple times.

All matching files are mapped directly to the root directory and marked public (circumventing the Login module).

This is only usefull for a very limited set of files like "favicon.ico" or "robots.txt". To make this work, this module needs to be configured after the login module.

Configuration

        <module>
                <modname>rootfiles</modname>
                <pm>RootFiles</pm>
                <options>
                        <path>Maplat/Web/Static</path>
                        <cache_control>max-age=3600, must-revalidate</cache_control>
                        <expires>+1h</expires>
                        <rootfile>favicon.ico</rootfile>
                        <rootfile>robots.txt</rootfile>
                        <login>authentification</login>
                </options>
        </module>

get

Deliver the static, chached files.

load_files

Internal function.

load_dir

Internal function.

Dependencies

This module depends on the Maplat::Web::Login module already beein configured.

SEE ALSO

Maplat::Web Maplat::Web::Login

AUTHOR

Rene Schickbauer, <rene.schickbauer@gmail.com>

COPYRIGHT AND LICENSE

Copyright (C) 2008-2011 by Rene Schickbauer

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.