Static cache header plugin

27 views
Skip to first unread message

Luc Didry

unread,
Jun 22, 2017, 4:58:03 AM6/22/17
to Mojolicious
Hello,

As discussed on the "Wishlist thread (fourth edition)"[1], I made a Mojolicious
Plugin which add Cache-Control header on served static files in production (the
header is not added in development mode):
https://metacpan.org/pod/Mojolicious::Plugin::StaticCache

It's basic and has very few options but it does the job.

The code is on https://framagit.org/luc/mojolicious-plugin-staticcache and
issues should be opened on
https://framagit.org/luc/mojolicious-plugin-staticcache/issues.

(if you don't have a framagit.org account, you can use Github authentication to
get one in a few clicks).

Comments and code contribution are welcome 🙂

[1] https://groups.google.com/forum/#!searchin/mojolicious/wishlist|sort:relevance/mojolicious/JLZlJwkm0Ho/mFE8CFIcAAAJ
--
Luc
https://fiat-tux.fr/
https://luc.frama.io/
Internet n'est pas compliqué, Internet est ce que vous en faites.

Jan Henning Thorsen

unread,
Jun 29, 2017, 8:22:03 AM6/29/17
to Mojolicious, l...@didry.org
Hey,


if ($mode ne 'development' || $even_in_dev) {

And I think I would store $mode and $even_in_dev outside of the "after_static" hook.
Reply all
Reply to author
Forward
0 new messages