Problem/Motivation

In D9/10 the fast 404 processor no long runs prior to routing so the concept of excluded paths is unnecessary. If you want proper 404s for image files for example then it is best to disable fast 404s altogether.

Proposed resolution

Remove the config key and write an update function to do that.

Remaining tasks

From #3292908-36: Fast 404s are slower than regular 404s: Decide wether to keep this in config or move it to settings. The exclude_paths config is meaningless in the current implementation. So deciding what to do with that and whether all the things should be config or settings feels all intimately related

User interface changes

None

API changes

None

Data model changes

system.performance:fast_404.excluded_paths is removed.

Release notes snippet

@todo

Issue fork drupal-3216687

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

AJV009 created an issue. See original summary.

ajv009’s picture

Status: Active » Needs review
StatusFileSize
new706 bytes
ajv009’s picture

Assigned: ajv009 » Unassigned

Status: Needs review » Needs work

The last submitted patch, 2: 3216687-1.patch, failed testing. View results

kunal_singh’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB

Modified the test cases.

njim’s picture

Status: Needs review » Reviewed & tested by the community

The change was implemented as described. Imagecache is no longer in the excluded_path attribute of the yaml file. Related tests were also updated. This should have no impact on current sites as it removed references to something that no longer exists. Code review is complete and everything looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs review

This will only affect new sites. As we're changing install configuration. I guess there is a question about whether or not we should update existing sites config value if it is still equal to '/\/(?:styles|imagecache)\//'. It's a bit tricky - could go either way. Thoughts anyone?

longwave’s picture

Not sure it is worth updating existing config. As fast 404 config is also listed in settings.php I was under the impression that most sites that change fast 404 config do it there rather than using drush cset or similar, as there is no UI for this feature. Speaking of which: the default in settings.php also includes system/files, should we make the same change here?

# $config['system.performance']['fast_404']['exclude_paths'] = '/\/(?:styles)|(?:system\/files)\//';

This was changed in #2455057: Fix fast 404 settings for private image files

njim’s picture

My impression is that this does not have any negative consequences if left within active configuration -- it's simply a relic of the old functionality. But I assume there is always a risk in rolling out a change to active configs on existing sites. So FWIW, I tend to leave these things alone unless I have complete control of the application.

Regarding the fast_404 change in #8, I prefer to create new tickets unless it makes sense to bundle work under a bigger epic.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

ajaypratapsingh’s picture

StatusFileSize
new1.29 MB

#5 Patch is applied Successfully on Drupal 9.3.x local machine

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

rinku jacob 13’s picture

StatusFileSize
new156.76 KB
new2.51 KB
new163.16 KB

Re-rolled patch for 9.5.x. Adding screenshots for the reference. Thanks @kunal_singh

longwave’s picture

Status: Needs review » Reviewed & tested by the community

RTBC assuming bot agrees.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

So imagecache getting there was my fault completely. See #1934716: [Followup] Merge system.fast_404 config object into system.performance which added it. Oops.

I think we should consider removing the override section from settings.php. It's weird that this is there. As far as I know there's no special reason to override this there as opposed to deploy it properly. I also think that we should consider adding system/files to the default exclude_paths if it is not there as this makes sense. I think we should do this here because we're changing the default value and rather than changing it twice - I think we should do that once.

I propose that we re-purpose this issue to: "Provide a better default for 'excluded_paths' system performance.yml and remove duplication in default.settings.php". That way we can get to a better place with respect to fast 404 settings in a single issue.

alexpott’s picture

Actually: re default.settings.php I think this is there because there is no UI so this is one way to configured this. However I'd bet a lot of D8/9 sites just use the default configuration so #2455057: Fix fast 404 settings for private image files should have changed the default config too. Hmmm... how do we prevent this getting out-of-sync in the future. The current state of HEAD is a bit of a mess.

longwave’s picture

Maybe we should just build an admin UI for it? I never understood why it didn't have one.

alexpott’s picture

@longwave because regexes are awful to validate?

rakhi soni’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB

Kindly review patch for version 9.5x,,

Munavijayalakshmi’s picture

Assigned: Unassigned » Munavijayalakshmi
Munavijayalakshmi’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new49.77 KB
new46.03 KB

Both #13 and # 19 same.
Both patches applied successfully.

alexpott’s picture

Status: Reviewed & tested by the community » Postponed

So this setting is completely pointless in D8/9/10 so we should remove it. Let's wait for #3292908: Fast 404s are slower than regular 404s and re-focus this issue into cleaning up the fast 404 config.

cilefen’s picture

@ajaypratapsingh, @Rinku Jacob 13 and @Munavijayalakshmi: Thank you for helping out. One thing I had been wanting to mention is that screenshots depicting patches applying or screenshots of code are unnecessary, are not contributions as such, and do not move code review forward, as there are automated systems that confirm diffs. There are a few review guides like this one which contain lots of tips on reviewing code. You can make more meaningful contributions by using those techniques.

alexpott’s picture

Title: Remove 'imagecache' from 'excluded_paths' in system.performance.yml » Remove 'fast_404.excluded_paths' from system.performance.yml
Issue summary: View changes
Status: Postponed » Needs work

Updated IS to be about what the current issue should do - now that #3292908: Fast 404s are slower than regular 404s has landed.

Munavijayalakshmi’s picture

Assigned: Munavijayalakshmi » Unassigned
Munavijayalakshmi’s picture

Needs work

eric_a’s picture

Version: 9.5.x-dev » 10.0.x-dev
Component: install system » base system
Issue summary: View changes
Issue tags: -Novice
Parent issue: #2987864: fast_404 paths should include "map" files »
Related issues: +#2987864: fast_404 paths should include "map" files, +#3292908: Fast 404s are slower than regular 404s

Fixing metadata to catch up with the repurposing by @alexpott. See #24.

jwilson3’s picture

Catch pointed me to this issue, which I was unaware of. I have a kind of a sister issue that takes a different approach for lowercase "faster" 404s from image api here.

I'm not certain if there is overlap, or if my issue is obviated by this one.

#3362929: Add minimal 4xx responses for invalid image derivative requests

quietone made their first commit to this issue’s fork.

Version: 10.0.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.