Flatten 404 to static file for performance gain...?
| Project: | CustomError |
| Version: | HEAD |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
As per Ted's post here: http://tedserbinski.com/tags/drupal/preventing-drupal-handling-404s-perf...
He has a point (unless I'm missing something) and it seems that if we were to configure the 404 to be handled "statically", we could also add functionality in customerror to support this.
So, let's say we set up the module as per normal (I have a lengthy example of this here), and we add a checkbox to the config screen, which says, "Cache 404 page as static". The module could check to see if Drupal/Apache is correctly configured to work for this, and if so, dump the contents of the whole page out as a file to that directory.
I suppose this hinges on a couple of assumptions which I don't rightly know the answer to. Does this need to be checked for validity (cached once per day, only on updates to the field, etc)? Can Drupal "export itself" to a flat file? Probably other stuff as well...
Just a thought! :)

#1
I use this module on several sites that get medium traffic, and it works just fine, so I am not sure if this is a case of optimization to the extreme.
Also, will this require too much messing around with .htaccess? If so, it is complicated enough for the users of this module.
Those who are more advanced can customize their installation in many ways, and may not need this module at all.
A related issue is actually here http://drupal.org/node/76824, where Drupal should not handle 404s for certain file types. If there is a missing css or jpg file, then drupal should not get involved at all.
#2
I think the above relates back to Ted's original post, actually...? You're probably right, but I thought it was worth mentioning. In high-traffic cases, a full bootstrap could still be deemed "expensive" to just generate a 404, right? (Usability issues aside)