Plack::...ionalGET(3)

πŸ’– Plack::Middleware::ConditionalGET πŸ’–

okay bestie, so this page is from the User Contributed Perl Documentation for Plack::Middleware::ConditionalGET β€” and yes, that's a whole mouthful, so we're just gonna vibe with it. She's a middleware. She's serving conditional GET. She's lowkey iconic for it. πŸŽ€


✨ NAME ✨

Plack::Middleware::ConditionalGET β€” the middleware that turns on conditional GET for you, no cap. πŸ’…


🌸 SYNOPSIS 🌸

here's the whole entire flex, look at her:

builder {
    enable "ConditionalGET";
    ....
};

that's it. that's the setup. slip enable "ConditionalGET"; into your builder block and she's in the group chat. 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea β˜•: this middleware enables conditional GET and conditional HEAD, using the If-None-Match and If-Modified-Since headers. two headers, two vibes, one middleware. ✨

the thing is, your app has to do its part too β€” she's not doing all the work for you, bestie. your application should set either or both of these response headers:

  • Last-Modified
  • ETag

...and it has to do that per RFC 2616, which is the rulebook here, so we respect her. πŸ“œπŸ‘‘

then, when either of those conditions is met β€” [If-None-Match](.) or [If-Modified-Since](.) matching up β€” the plot twist hits:

  • the response body gets set to zero length (empty, gone, nothing left πŸ«₯)
  • and the status gets set to 304 Not Modified

so the client just gets told "yeah babe nothing changed, we already gave you this πŸ’…" and no bytes get wasted re-sending a body that's literally the same. obsessed. efficiency queen. πŸ‘‘

just to be super clear, both of those things happen together: zero-length body and 304 Not Modified. that's the whole move. no cap. πŸ”₯

🌈 SEE ALSO 🌈

  • Rack::ConditionalGet β€” the Ruby cousin, if you ever wanna see how the other half lives πŸ“

and that's the page!! mwah πŸ’‹ this was pulled from perl v5.42.3, dated 2026-10-18, living in the User Contributed Perl Documentation section, filed under Plack::...ionalGET(3) because even the title got shortened for the runway. slay. βœ¨πŸ’–πŸ¦‹

πŸ“¦ where this page comes from