Hi!

I finally got around to publishing a little plugin that we've had running internally for some time now: Catalyst::Plugin::ExternalURI.

When you're working with CDNs or AWS S3 Buckets where you leave static files like videos, css, js, etc (to have them served from S3) and you have written all your links with [% c.uri_for('/static/assetX') %], this plugin helps you rewrite the output of c.uri_for so that it doesn't point back to your app server.

One benefit is that you can upload static files to /versionX/static/, and have the plugin prepend the version of your application to the URIs. That way, when deploying a new version you don't have cache problems (as the URLs are different), and you don't have to do anything to your templates.

Also we will have "devel mode" (the plugin will not rewrite URLs) and production mode, where the offloading to S3 is supposed to happen with something like this:

    externaluri => [
        ($ENV{'APP_MODE'} eq 'development')?{ '^/static' => '...' }:()
    ],


Hope it helps somebody. Sure did help us :)

Jose Luis Martinez
jlmarti...@capside.com

_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to