Category Archives: PHP

Slim framework 3 – Passing Custom Headers to error pages

So during work today I ran into an issue. There were a lot of users connecting and some pages were showing Slim Frameworks custom error pages.

A website error has occurred. Sorry for the temporary inconvenience.

Now you’ve seen this error from time to time and usually it’s not a huge problem, for us that issue resulted in too many connections to our database at once while the page cache was rebuilding. Usually this fixes itself (and I probably should add a workaround to that soon), but we’re using Litespeed Cache. Litespeed sucks, not because it’s bad software, but because when shit hits the fan litespeed can cache it and it’s very painful to deal with. Which in our case it was caching that slim error page “website error has occurred”. That’s no good so I needed to tell litespeed not to cache the page when this happens.

Continue reading