You are here

README.txt in Fast 404 8.2

Same filename and directory in other branches
  1. 8 README.txt
Fast 404 is Super Fast and Super Amazing. It is also aggressive and hard-core.

BE CAREFUL! TEST YOUR SITE THOROUGHLY AFTER ENABLING!


-----------------------------------------------------------------
BASIC INSTALLATION INSTRUCTIONS
-----------------------------------------------------------------

*NOTE, THIS ONLY CHECKS STATIC FILES AND NOT DRUPAL PATHS*
(no settings.php modifications needed)

Step 1. Upload the module to your standard modules location (usually /modules).
Step 2. Enable the module in your modules page.


-----------------------------------------------------------------
ADVANCED INSTALLATION INSTRUCTIONS
-----------------------------------------------------------------

Step 1. Upload the module to your standard modules location (usually /modules).
Step 2. Copy the example.settings.fast404.php to your site folder and rename it
  to settings.fast404.php.
Step 3. Place the include code below at the end of your settings.php file.
Step 4. Optionally, modify the include_once path in the example
  settings.fast404.php if you did not put the module in /modules.
Step 5. Enable the module in your modules page.

/**
 * Load fast404 configuration, if available.
 *
 * Use settings.fast404.php to provide settings for Fast 404 module.
 *
 * Keep this code block at the end of this file to take full effect.
 */
#
# if (file_exists($app_root . '/' . $site_path . '/settings.fast404.php')) {
#   include $app_root . '/' . $site_path . '/settings.fast404.php';
# }


-----------------------------------------------------------------
GETTING EXTRA SPEED OUT OF THE ADVANCED INSTALL
-----------------------------------------------------------------

#1) Check extensions from settings.php, not after loading all modules.

  WARNING: This is not fully implemented and not ready for to use.
  @see: https://www.drupal.org/project/fast_404/issues/2961512

  This method is faster as it checks for missing static files at bootstrap
  stage 1 rather than 5 when the modules are loaded and events dispatched.

  To enable this functionality, uncomment the lines below near the bottom of the
  example settings.fast404.php code:

  if (file_exists($app_root . '/modules/contrib/fast_404/fast404.inc')) {
    include_once $app_root . '/modules/contrib/fast_404/fast404.inc';
    fast404_preboot($settings);
  }

#2) Enable Drupal path checking

  This checks to see if the URL being visited actually corresponds to a
  real page in Drupal. This feature may be enabled with the following.

  Global switch to turn this checking on and off (Default: off):

  $settings['fast404_path_check'] = FALSE;

#3) Give the static file checking a kick in the pants!

  Static file checking does require you to keep an eye on the extension list
  as well as a bit of extra work with the preg_match (OK, a very small amount).
  Optionally, you can use whitelisting rather than blacklisting. To turn this
  on, alter this setting in the settings.php:

  $settings['fast404_url_whitelisting'] = TRUE;

  This setting requires you to do some serious testing to ensure your site's
  pages are all still loading. Also make sure this list is accurate for your
  site:

  $settings['fast404_whitelist']  = ['index.php', 'rss.xml', 'install.php', 'cron.php', 'update.php', 'xmlrpc.php'];

#4) Disallow imagestyles file creation for anonymous users

  Normally the module skips out if 'styles' is in the URL to the static file.
  There are times when you may not want this (it would be pretty easy for
  someone to take down your site by simply hammering you with URLs with
  image derivative locations in them.

  In an ideal situation, your logged in users should have verified the pages
  are loading correctly when they create them, so any needed image derivatives
  are already made. This new setting will make it so that image derivative URLs
  are not excluded and fall under the same static file rules as non-imagestyles
  URLs. Set to false to enable this new feature.

  $settings['fast404_allow_anon_imagecache'] = TRUE;

#5) Prevent conflicts with other modules

  Some performance modules create paths to files which don't exist on disk.
  These modules conflict with fast404. To workaround this limitation, you
  can whitelist the URL fragments used by these modules.

  For example if you are using the CDN module and have the far future date
  feature enabled add the following configuration:

  $settings['fast404_string_whitelisting'] = ['cdn/farfuture'];

  If you are using AdvAgg you can use this:

  $settings['fast404_string_whitelisting'] = ['/advagg_'];

  Any further modules/paths that may need whitelisting can be added to the array.

File

README.txt
View source
  1. Fast 404 is Super Fast and Super Amazing. It is also aggressive and hard-core.
  2. BE CAREFUL! TEST YOUR SITE THOROUGHLY AFTER ENABLING!
  3. -----------------------------------------------------------------
  4. BASIC INSTALLATION INSTRUCTIONS
  5. -----------------------------------------------------------------
  6. *NOTE, THIS ONLY CHECKS STATIC FILES AND NOT DRUPAL PATHS*
  7. (no settings.php modifications needed)
  8. Step 1. Upload the module to your standard modules location (usually /modules).
  9. Step 2. Enable the module in your modules page.
  10. -----------------------------------------------------------------
  11. ADVANCED INSTALLATION INSTRUCTIONS
  12. -----------------------------------------------------------------
  13. Step 1. Upload the module to your standard modules location (usually /modules).
  14. Step 2. Copy the example.settings.fast404.php to your site folder and rename it
  15. to settings.fast404.php.
  16. Step 3. Place the include code below at the end of your settings.php file.
  17. Step 4. Optionally, modify the include_once path in the example
  18. settings.fast404.php if you did not put the module in /modules.
  19. Step 5. Enable the module in your modules page.
  20. /**
  21. * Load fast404 configuration, if available.
  22. *
  23. * Use settings.fast404.php to provide settings for Fast 404 module.
  24. *
  25. * Keep this code block at the end of this file to take full effect.
  26. */
  27. #
  28. # if (file_exists($app_root . '/' . $site_path . '/settings.fast404.php')) {
  29. # include $app_root . '/' . $site_path . '/settings.fast404.php';
  30. # }
  31. -----------------------------------------------------------------
  32. GETTING EXTRA SPEED OUT OF THE ADVANCED INSTALL
  33. -----------------------------------------------------------------
  34. #1) Check extensions from settings.php, not after loading all modules.
  35. WARNING: This is not fully implemented and not ready for to use.
  36. @see: https://www.drupal.org/project/fast_404/issues/2961512
  37. This method is faster as it checks for missing static files at bootstrap
  38. stage 1 rather than 5 when the modules are loaded and events dispatched.
  39. To enable this functionality, uncomment the lines below near the bottom of the
  40. example settings.fast404.php code:
  41. if (file_exists($app_root . '/modules/contrib/fast_404/fast404.inc')) {
  42. include_once $app_root . '/modules/contrib/fast_404/fast404.inc';
  43. fast404_preboot($settings);
  44. }
  45. #2) Enable Drupal path checking
  46. This checks to see if the URL being visited actually corresponds to a
  47. real page in Drupal. This feature may be enabled with the following.
  48. Global switch to turn this checking on and off (Default: off):
  49. $settings['fast404_path_check'] = FALSE;
  50. #3) Give the static file checking a kick in the pants!
  51. Static file checking does require you to keep an eye on the extension list
  52. as well as a bit of extra work with the preg_match (OK, a very small amount).
  53. Optionally, you can use whitelisting rather than blacklisting. To turn this
  54. on, alter this setting in the settings.php:
  55. $settings['fast404_url_whitelisting'] = TRUE;
  56. This setting requires you to do some serious testing to ensure your site's
  57. pages are all still loading. Also make sure this list is accurate for your
  58. site:
  59. $settings['fast404_whitelist'] = ['index.php', 'rss.xml', 'install.php', 'cron.php', 'update.php', 'xmlrpc.php'];
  60. #4) Disallow imagestyles file creation for anonymous users
  61. Normally the module skips out if 'styles' is in the URL to the static file.
  62. There are times when you may not want this (it would be pretty easy for
  63. someone to take down your site by simply hammering you with URLs with
  64. image derivative locations in them.
  65. In an ideal situation, your logged in users should have verified the pages
  66. are loading correctly when they create them, so any needed image derivatives
  67. are already made. This new setting will make it so that image derivative URLs
  68. are not excluded and fall under the same static file rules as non-imagestyles
  69. URLs. Set to false to enable this new feature.
  70. $settings['fast404_allow_anon_imagecache'] = TRUE;
  71. #5) Prevent conflicts with other modules
  72. Some performance modules create paths to files which don't exist on disk.
  73. These modules conflict with fast404. To workaround this limitation, you
  74. can whitelist the URL fragments used by these modules.
  75. For example if you are using the CDN module and have the far future date
  76. feature enabled add the following configuration:
  77. $settings['fast404_string_whitelisting'] = ['cdn/farfuture'];
  78. If you are using AdvAgg you can use this:
  79. $settings['fast404_string_whitelisting'] = ['/advagg_'];
  80. Any further modules/paths that may need whitelisting can be added to the array.