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.
Problem/Motivation
Port:
CDN_SEO_*
constants incdn.constants.inc
cdn_boot()
incdn.module
_cdn_seo_should_redirect()
incdn.module
cdn_admin_other_settings_form()
incdn.admin.inc
cdn_ui/help/admin-other-seo.html
CDNSEOTestCase
in tests/cdn.test
Proposed resolution
Should be implemented as a Stack middleware, because hook_boot()
no longer exists in Drupal 8
Eventually should be published on http://stackphp.com/, because this is not in any way Drupal-specific. (It's basically redirecting all user agents except the whitelisted ones to the canonical domain for all HTML content.)
Remaining tasks
User interface changes
API changes
Data model changes
Yes.
Comment | File | Size | Author |
---|---|---|---|
#19 | cdn_seo_port-2708771-19.patch | 32.06 KB | Wim Leers |
Comments
Comment #2
Wim LeersComment #3
Wim LeersComment #4
Wim LeersComment #5
Wim LeersComment #6
Wim LeersPort is mostly done.
Comment #7
Wim LeersReverting some out of scope changes.
Comment #8
Wim LeersI made one big mistake in this patch: this middleware runs always, even when the CDN module's status is set to disabled. We'd need it to work only when it's set to
enabled
… but doing so will make the middleware significantly slower, and hence also make Page Cache significantly slower. Because it'll mean initializing the config system and everything it depends on very early in the request.Comment #9
Wim LeersNot sure yet what to do, but reuploading #7 in the mean time so it is tested. I fixed the automated testing settings for this project.
Comment #12
Wim LeersComment #13
Wim LeersThe problem described in #8 reminded me of #2424309: Expose more language container parameters, to allow services to be language-aware efficiently. I posted a new comment there, at #15:
I think the conclusion is clear. You change that configuration rarely, so you want the common case to much faster. So we rebuild the container when necessary.
Comment #14
Wim LeersClean-up.
Comment #16
Wim LeersNits.
Comment #17
Wim LeersNote that this already incorporated #2678374-16: Document that SEO (duplicate content prevention) causes redirect loop in combination with reverse proxy between CDN and web server.
Comment #18
Wim LeersActually, all of the green patches above… they're not running my new unit test yet :/
Comment #19
Wim LeersHah! Detail.
run-tests.sh
is so frustrating…Comment #20
Wim Leers52 passes instead of 38! That's more like it :)
Comment #22
Wim LeersYay!