According to apache documentation, the final parameter of ErrorDocument can be specified as a path, URL or text to any error code.
What I have done so far to eliminate any calls to the I/O file system is to use text as my final value. For example, I use the following in my httpd.conf file:
ErrorDocument 404 "Error: Not Found"
And of course when I restart apache and a user requests a file not being found, they only see "Error: Not found" on the screen.
All is well until I trigger the error in Google's page-speed insights.
Here's the URL to the test:
Pagespeed tells me to configure the viewport and to use legible font sizes.
I personally think its an overkill considering that I made the size of the error pages so small to prevent bots from sucking up my bandwidth, and now it seems the solution is to add a 1000% byte increase per error triggered just to make google happy. (That's right, I'd have to go from 50 or so bytes to over 500).
I could rant more, but what I'm considering to make everyone happy is to format my error pages to contain HTML but without the need of accessing the file system. For example, I want to include something like this in my httpd.conf:
ErrorDocument 404 '<html><head><meta name="viewport" content="width:device-width"></head><body>Not found</body></html>'
Such HTML would make the page more compatible with mobile users, but the question is, would apache accept html as text? and if so, how do I rearrange it in the best form so that apache outputs it as raw html so that the browser converts the data correctly for the client? I ask that because my value has quotes in it and I don't want apache thrown off.