Bug 39976 - Serving static error pages from Apache instead of Starman
Summary: Serving static error pages from Apache instead of Starman
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-05-23 01:50 UTC by David Cook
Modified: 2025-05-23 01:50 UTC (History)
0 users

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2025-05-23 01:50:45 UTC
At the moment, all error documents are produced dynamically by Starman/Koha.

When Apache encounters an error, it uses custom ErrorDocument directives which end up proxying to Starman to get the errors. For example, http://localhost:8081/blah. 

When Plack encounters an error, it needs to produce its own error documents and that's why we have the ErrorDocument middleware. For example, an Internal Server Error in a Perl script. Since we're using persistent processes, this is mostly fine.

But if someone does 100 concurrent requests to http://localhost:8081/blah, it doesn't really make sense to transfer that load onto Starman/Plack. It would be good if Apache could just handle it without touching the backend.

Pre-generating static pages isn't a big drama in itself, but the issue we'll face is multilingualism. 

But... in theory we could use mod_negotiation or mod_rewrite to do an internal redirect to the language appropriate error document (based off the Koha Language cookie ).