[Catalyst] RFC: file/path writing sub-class
of Catalyst::Plugin::Static::Simple
apv
apv at sedition.com
Sun Nov 26 22:13:34 GMT 2006
On Nov 26, 2006, at 2:01 PM, Ash Berlin wrote:
> apv wrote:
>> I'm probably about to write a sub-class of
>> Catalyst::Plugin::Static::Simple which writes the file to disk on
>> the first request. The reason is I like to have all my extra
>> static files (images, media, css, etc) in the same bundle as the
>> application but I also want to let Apache serve them, obviously.
>> So I can either try to keep a tree sync'd between my app path and
>> my webserver path or do this so the authoritative versions in the
>> app path are written to disk on first request. (Semi-)Permanent
>> cache.
>> Do you think this is something useful enough to also put on the
>> CPAN? Other feedback?
>> Name? Catalyst::Plugin::Static::DiskWrite? The idea is not to be
>> able to check for freshness or other cache-like behavior but to
>> write it if it's not there and leave it at that. Used with things
>> like:
>> RewriteCond %{REQUEST_FILENAME} !-f
>> RewriteRule ^(.*) /index.fcgi/$1 [QSA,L]
>
>
> Can you not just do:
>
> Alias /static /path/to/my/app/static
>
> In your Apache (or whatever) config?
Hmmmmm… I could but I'm not smart/awake enough to think to try it
first. Sigh!
I realize now that when I was doing this idea previously (manually
from and "end") it was using templates so the content was dynamic but
rarely changing. I'll rethink the whole thing.
Thanks, man.
-Ashley
More information about the Catalyst
mailing list