WordPress.org

Make WordPress Core

Opened 2 years ago

#40777 new enhancement

Using a static 404 HTML file (dynamically generated) (and/ or .htaccess instead of favicon.ico)

Reported by: design_dolphin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.8
Component: Bootstrap/Load Keywords:
Focuses: performance Cc:

Description

This is a follow-up to #3426.

Issue:
favicon.ico is loaded and this causes an additional request when loading a page, even when a website is not using this browser feature. I'm not going to rehash the pro and con arguments in the previous ticket, and instead will focus on continuing towards the future from here.

Possible Solution:

If the issue is that serving 404 costs too much CPU, etc, wouldn't it be better to serve a static 404 then? E.g. a (cached from the theme) html page and/or through .htaccess

For example in .htaccess:

ErrorDocument 404 "<H1>Page not found</H1>"

or

ErrorDocument 404 /404.html

Additional performance benefit:
This could eliminate a broader range of performance issues with generating a dynamic 404.

Source .htaccess example:
http://www.inmotionhosting.com/support/website/how-to/set-404-via-htaccess

Change History (0)

Note: See TracTickets for help on using tickets.