Skip to main content
edited tags
Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284
added 4 characters in body
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

D7.9 introduced 404 fast paths which don't fully bootstrap drupal on 404's for certain file types if it's enabled, thus saving some bandwidth / computation. More info is available here: http://drupal.org/node/1296384

By default this excludes only certain file types such as .jpg, .txt., etc., looks like this:

$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpeg|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';

I want to use this for all paths. Are there any repercussions to that?

I tried changing it to

$conf['404_fast_paths'] = '/*$/i'; 

However, this returns a warning, "Warning: preg_match() Compilation failed: nothing to repeat at offset 0 in drupal_fast_404() (line 2484 of /cms/main/includes/bootstrap.inc).

Warning: preg_match() Compilation failed: nothing to repeat at offset 0 in drupal_fast_404() (line 2484 of /cms/main/includes/bootstrap.inc).

So what should the syntax look like up there to both work and not generate a warning?

Alternatively, if there isn't a solution to this specific question, is there a way I can speed up 404's for all Drupal pages, would it better to use the Fast 404 contributed module for instance?

D7.9 introduced 404 fast paths which don't fully bootstrap drupal on 404's for certain file types if it's enabled, thus saving some bandwidth / computation. More info is available here: http://drupal.org/node/1296384

By default this excludes only certain file types such as .jpg, .txt., etc., looks like this:

$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpeg|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';

I want to use this for all paths. Are there any repercussions to that?

I tried changing it to

$conf['404_fast_paths'] = '/*$/i'; 

However, this returns a warning, "Warning: preg_match() Compilation failed: nothing to repeat at offset 0 in drupal_fast_404() (line 2484 of /cms/main/includes/bootstrap.inc).

So what should the syntax look like up there to both work and not generate a warning?

Alternatively, if there isn't a solution to this specific question, is there a way I can speed up 404's for all Drupal pages, would it better to use the Fast 404 contributed module for instance?

D7.9 introduced 404 fast paths which don't fully bootstrap drupal on 404's for certain file types if it's enabled, thus saving some bandwidth / computation. More info is available here: http://drupal.org/node/1296384

By default this excludes only certain file types such as .jpg, .txt., etc., looks like this:

$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpeg|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';

I want to use this for all paths. Are there any repercussions to that?

I tried changing it to

$conf['404_fast_paths'] = '/*$/i'; 

However, this returns a warning:

Warning: preg_match() Compilation failed: nothing to repeat at offset 0 in drupal_fast_404() (line 2484 of /cms/main/includes/bootstrap.inc).

So what should the syntax look like up there to both work and not generate a warning?

Alternatively, if there isn't a solution to this specific question, is there a way I can speed up 404's for all Drupal pages, would it better to use the Fast 404 contributed module for instance?

Source Link

What is the syntax for setting 404 fast paths on all Drupal pages in D7 > 7.9

D7.9 introduced 404 fast paths which don't fully bootstrap drupal on 404's for certain file types if it's enabled, thus saving some bandwidth / computation. More info is available here: http://drupal.org/node/1296384

By default this excludes only certain file types such as .jpg, .txt., etc., looks like this:

$conf['404_fast_paths_exclude'] = '/\/(?:styles)\//';
$conf['404_fast_paths'] = '/\.(?:txt|png|gif|jpeg|css|js|ico|swf|flv|cgi|bat|pl|dll|exe|asp)$/i';

I want to use this for all paths. Are there any repercussions to that?

I tried changing it to

$conf['404_fast_paths'] = '/*$/i'; 

However, this returns a warning, "Warning: preg_match() Compilation failed: nothing to repeat at offset 0 in drupal_fast_404() (line 2484 of /cms/main/includes/bootstrap.inc).

So what should the syntax look like up there to both work and not generate a warning?

Alternatively, if there isn't a solution to this specific question, is there a way I can speed up 404's for all Drupal pages, would it better to use the Fast 404 contributed module for instance?