Bug 39976

Summary: Serving static error pages from Apache instead of Starman
Product: Koha Reporter: David Cook <dcook>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

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 ).