Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
In my project i need ability to improve performance of redirects made by Global redirect.
Most of them take about 300 ms to run full bootstrap.
I think it's great option to cache redirects with default Cache-control headers.
My patch adds option to configuration page and header will be added on any module's redirect.
Comment | File | Size | Author |
---|---|---|---|
#2 | globalredirect-cache_301_redirects-2206771-2.patch | 1.76 KB | mcdruid |
add-cache-redirect-option.patch | 1.77 KB | IRuslan | |
Comments
Comment #1
lahoosascoots CreditAttribution: lahoosascoots as a volunteer commentedI'd love to see this get merged. The extra bootstrapping is causing some pain for a site I'm working on, 80% of the traffic is a deslashing 301.
Comment #2
mcdruidTiny tweak to the patch which just changes the wording in the admin form slightly.
Apart from that, tested this and it works great; marked as RTBC.
This could save a lot of sites a lot of bootstraps.
Comment #3
DanielWashbrook CreditAttribution: DanielWashbrook commentedJust tried this beauty out and it worked nicely! Thanks!
Comment #4
Dave ReidWorth mentioning that this can cause horrible infinite redirect loops with the "Case Sensitive URL Checking" feature enabled: https://gist.github.com/davereid/bd3f6b6e45634c88eb6d
Comment #5
Dave ReidI would maybe encourage this redirect caching patch in core: #1678348: Add redirects to be cached in drupal_goto()