Cataly...e::ESI(3pm)

πŸ“¦
version 0.10 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– Cataly...e::ESI(3pm) πŸ’–

okay bestie, so this is a page from the User Contributed Perl Documentation collection β€” yes that whole vibe β€” and it's all about Catalyst::View::Component::SubInclude::ESI. Let's get into it πŸ¦‹


✨ NAME ✨

Catalyst::View::Component::SubInclude::ESI β€” it's the Edge Side Includes (ESI) plugin for C::V::Component::SubInclude. that's the whole thing, that's the name, slay πŸ’…


🌸 VERSION 🌸

Version 0.07_03 β€” yeah it's got that underscore, that's a dev release vibe, no cap.


πŸŽ€ SYNOPSIS πŸŽ€

first up, in your view class, you're gonna do this:

package MyApp::View::TT;
use Moose;

extends 'Catalyst::View::TT';
with 'Catalyst::View::Component::SubInclude';

__PACKAGE__->config( subinclude_plugin => 'ESI' );

and then, somewhere in your templates, literally just:

[% subinclude('/my/widget') %]

that's it. that's the whole ritual. iconic ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so "Catalyst::View::Component::SubInclude::ESI" takes your subinclude calls and renders them as Edge Side Includes (ESI) include directives. this is a feature that Varnish implements (<http://varnish.projects.linpro.no/>) and it lets you do cache-efficient uses of includes. cache-efficient!! we love a performance moment πŸ”₯


πŸ’œ METHODS πŸ’œ

🌈 generate_subinclude( $c, $path, @args ) 🌈

heads up bestie: $path should be the private action path β€” the translation to the public path is handled internally, don't you worry about it, the module's got you 🫢

after translation, this roughly translates to the following code:

my $url = $c->uri_for( $translated_path, @args )->path_query;
return '<!--esi <esi:include src="$url" /> -->';
⚠️ also important: the stash will always be empty. like, always. this behavior could be configurable in the future through an additional switch β€” for now though, this behavior guarantees a common interface for plugins. so it's a feature not a bug, periodt πŸ’…

πŸ‘‘ SEE ALSO πŸ‘‘

go peek at these when you're done here:


🫢 AUTHOR 🫢

Nilson Santos Figueiredo Junior, "<nilsonsfj at cpan.org>" β€” the main character who made this happen, we stan 🌟


πŸ’Έ SPONSORSHIP πŸ’Έ

Development sponsored by Ionzero LLC <http://www.ionzero.com/>. thank you for funding the arts πŸ™βœ¨


Copyright (C) 2009 Nilson Santos Figueiredo Junior.

Copyright (C) 2009 Ionzero LLC.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


and that's the whole page, bestie β€” you ate that πŸ“

this was brought to you by perl v5.34.0, dated 2022-06-09, straight out of Cataly...e::ESI(3pm). mwah πŸ’‹

πŸ“¦ where this page comes from