Plack::...Shotgun(3)

✨ NAME ✨

bestie. you're looking at Plack::Loader::Shotgun(3) β€” the forking implementation of plackup. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

plackup -L Shotgun

that's it. that's the whole setup. Chef's kiss. πŸŽ€


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, and it's genuinely delicious: the Shotgun loader doesn't compile and run your app right away. it delays the compilation and the execution of your application allll the way until runtime. the moment a new request comes in, it forks a brand-new child, compiles your code right then, and runs the application inside that child. 🌱✨

and lowkey this is your ultimate alternative when:

  • reloading with Plack::Middleware::Refresh just isn't working for you 😭
  • the default -r filesystem watcher that plackup gives you is causing Problemsβ„’ πŸ‘€

and no cap, I can totally imagine this being the move for applications that expect their application to only be evaluated once (in-file templates, looking at you 🫡) β€” or for operating systems with a broken fork implementation, etc etc. the list goes on, bestie. πŸ€·β™€οΈ

it's giving… the good old CGI fork-and-run, except iconic: you don't need a web server at all 🌈, AND you get the bonus of preloading modules that aren't likely to change. so like, say you're developing a web application using Moose and DBIx::Class:

plackup -MMoose -MDBIx::Class -L Shotgun yourapp.psgi

that would preload those modules, and then only re-evaluate your code on every single request. so efficient. so clean. so main character energy. πŸ‘‘β­


πŸ¦‹ AUTHOR πŸ¦‹

Tatsuhiko Miyagawa β€” with an inspiration from http://github.com/rtomayko/shotgun 🫢


πŸ’œ SEE ALSO πŸ’œ

  • plackup β€” the whole reason this loader even exists, fr fr

πŸ’€ reminder, babe: this page is perl v5.42.3 from 2026-10-18, and you've been reading Plack::...Shotgun(3). stay forky, stay cute. πŸŒΈπŸ’–
πŸ“¦ where this page comes from