Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mark Redirect Map Manager as enabled in AEM CS #274

Conversation

krystiannowak
Copy link
Contributor

@krystiannowak krystiannowak commented Sep 20, 2024

cc: @davidjgonzalez @SachinMali @joerghoh @chaik @froesef

@krystiannowak krystiannowak marked this pull request as ready for review September 20, 2024 11:35
Copy link
Contributor

@kwin kwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With having two redirect features in place now in ACS AEM Commons (also https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/index.html) there should be clarification when it is recommended to use which one. I currently fail to see the need for this solution, given that the CDN is caching the redirects from https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/index.html (at least with AEMaaCS).

@krystiannowak
Copy link
Contributor Author

krystiannowak commented Sep 20, 2024

@kwin Trying to clarify the question you asked:

With having two redirect features in place now in ACS AEM Commons (also https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/index.html) there should be clarification when it is recommended to use which one. I currently fail to see the need for this solution, given that the CDN is caching the redirects from https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-manager/index.html (at least with AEMaaCS).

I think (please correct me if I'm wrong and/or I couldn't find) there RM does not explain why it got created even though RMM already existed, besides implicit rationale that at that time RMM was working only for on-prem/AMS but not AEMaaCS.

Possibly there might be a need to explain somewhere why some users prefer not to have all requests for such AEM-controllable/editable/manageable "redirects" (but not only) never reach AEM publish tier, but rather to be handled at most at Apache HTTPD/dispatcher tier only (as dispatcher module is unable to cache 30x responses directly).

Leaving even the request which would be (probably) redirected in the end not to be propagated to AEM publish tier, there are also scenarios where certain Apache HTTPD and/or request-specific properties or variables are to be evaluated before given decision what exact processing (so also possibly redirect) to make (e.g. header-based, cookie-based, geolocation-based etc). If variability domain of such decision key is large (so that Vary is not feasible through CDN for caching) and/or user of this functionality does not want it to be cached in CDN layer as a redirect, but a rewrite to a response with 200 OK should be made, then the most correct place in the stack (assuming previous prerequisites) is the Apache HTTPD / dispatcher tier in this scenario.

Not sure if for non-AEMaaCS cases there is any comparison why RM or RMM should be used and for which scenario one is a better fit than the other. Maybe the potential user should decide if they like their request to go as far as to AEM publish tier for a decision, or would they prefer it to be processed in a tier earlier (Apache HTTPD/dispatcher) in which case it doesn't need to be a redirect in result per se, but rather mod_rewrite's rewrite (where redirect is just one of the possible options)?

It is also worth to add the Purpose paragraph of RMM:

This tool allows content administrators, system administrators and Search Engine Optimization teams to easily maintain and publish Apache httpd Redirect Map files without requiring an Apache restart. These files can manage large lists of redirects and rewrites in the Apache httpd / AEM Dispatcher.

so even if historically the name is Redirect Map Manager, still in fact what it does it providing a way to steer Apache HTTPD rewrites from AEM, and redirect is just one of multiple ways rewrites might end up.

@kwin
Copy link
Contributor

kwin commented Sep 20, 2024

For me the biggest downside of RMM is the additional complexity of pulling the rewrite map file from AEM, therefore I would currently state as a rule of thumb: Use RM if you have a CDN capable of caching 3xx responses, otherwise use RMM.

@krystiannowak
Copy link
Contributor Author

krystiannowak commented Sep 20, 2024

@kwin There is some explanation for the downside you had expressed in:

For me the biggest downside of RMM is the additional complexity of pulling the rewrite map file from AEM, therefore I would currently state as a rule of thumb: Use RM if you have a CDN capable of caching 3xx responses, otherwise use RMM.

Some users do not wish to have 3xx responses for some old or non-maintained any more links, some work around it with lots of RewriteCond+RewriteRule statements, some use static RewriteMap maps, but maintaining them requires changes in Apache HTTPD configuration each time - not all users want or (in the long run) can do it efficiently and timely - so editing them via AEM authoring while still being able to use the functionality done once in Apache HTTPD configuration for it (and further just changing the content on AEM side that it is using) is what they foresee (otherwise they would have already chosen RM but it's not 100% fit for their needs), hence enabling RMM on AEMaaCS as well (they way - at least from AEM-side functionality perspective - as it worked so far on-prem/AMS) is a way to go for them.

Pulling rewrite map currently (for on-prem/AMS) might be indeed quite troublesome/low-level with cron, shell etc. for some, that is why for AEMaaCS it is meant to be as simple as possible - but so far it's still in Early Adopter Program phase to be opted-in - see https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/release-notes/release-notes/2024/release-notes-2024-5-0#apache-rewritemaps-early-adopter and ACS Commons' RMM is meant to be one of the multiple possible sources of map data for it exposed from AEM tier:

Business users can declare redirects outside of Git (Early Adopter Program)
Similar to AEM 6.5, Apache/dispatcher will ingest rewrite maps placed in a specific location in the publish repository, and load them, without requiring a web tier pipeline execution. This opens up opportunities for a business user to declare redirects using either a spreadsheet or a UI, such as that offered by ACS Commons Redirect Map Manager or created as part of a customer application.

@YegorKozlov
Copy link
Contributor

@krystiannowak

I think (please correct me if I'm wrong and/or I couldn't find) there RM does not explain why it got created even though RMM already existed, besides implicit rationale that at that time RMM was working only for on-prem/AMS but not AEMaaCS.

The motivation was to create an AEM tool, aware of the AEM features like content-aware configurations, etc. I also wanted it to be user-friendlier than RMM. I'm not saying RMM is not good, but I wouldn't recommend it as a go-to solution. And user acceptance of RM speaks for itself. There can be cases when you would want to redirect from HTTPd, but these are edge cases . Most times RM will work well.

@kwin Now, when we have two redirect solutions having similar names it can be confusing. I wonder if it's a good idea to combine them into one, like, edit redirect rules in RM and have a way to compile them into the HTTPd format and use the same mechanism to push it to HTTPD.
@krystiannowak does that sound like a good idea to you?

Regards,
Yegor

@joerghoh
Copy link
Contributor

Hi @kwin , @YegorKozlov

I think it's a bit unfortunate that ACS AEM Commons adopted 2 different solutions for a very similar usecase, and then even have their names very similar to almost identical... but now we have to live with it.

Right now we are planning to add explicit support in AEM CS for the RMM, as it's a more convenient way to maintain redirects than having to add them into git and deploy them with a webtier pipeline. While serving redirects directly out of AEM might give you more flexibility, it's problematic regarding any kind of scaling. Serving them from the dispatcher (or even from the CDN) is much better.

@YegorKozlov I like your approach to merge the 2 approaches into a single solution; especially if it could follow the approach of RM regarding the integration into dispatcher.

@kwin
Copy link
Contributor

kwin commented Sep 24, 2024

I agree that we should merge the two by extending RM with the RMM capability (not the other way around) as maintenance is much easier with RM. @joerghoh Is there any restriction about the format of redirect map file (going beyond https://httpd.apache.org/docs/2.4/rewrite/rewritemap.html#txt) or the URL from which it should be served?

@krystiannowak
Copy link
Contributor Author

krystiannowak commented Sep 24, 2024

@kwin The format is that "plain-text mapping file, containing one space-separated key/value pair per line" as described in https://httpd.apache.org/docs/2.4/rewrite/rewritemap.html#txt and additionally consumable by https://httpd.apache.org/docs/2.4/programs/httxt2dbm.html utility - with the constraints mentioned also in https://adobe-consulting-services.github.io/acs-aem-commons/features/redirect-map-manager/index.html#purpose e.g. "Note that Apache has an 1024 length limit for RewriteMap single entries."

@joerghoh
Copy link
Contributor

So my conclusion to this topic:

  • We should merge RM with RMM (or the other way around, I don't have any preferences) into a "Universal Redirect Manager (URM); but that's nothing on short term.

I just discussed with @krystiannowak offline, that the format specifier he provided could be considered as a version 1 of that interface, and that it should be possible to eventually create a version 2, which can support more features.

And then the next steps would be:

  • Approve and merge this PR, and get it released.
  • As soon as the RMM support is officially announced for AEM CS, official documentation will be provided, including the details of the format of the interface (v1). This will be the one @krystiannowak outlined, but just in official :-)
  • And then the work on URM can be started, and requirements for a version 2 of that interface can be specified.

@krystiannowak krystiannowak marked this pull request as draft September 24, 2024 16:20
@krystiannowak krystiannowak marked this pull request as ready for review September 24, 2024 16:20
@krystiannowak
Copy link
Contributor Author

@joerghoh
Copy link
Contributor

I would merge this PR by tomorrow EOB (Sept 27), as it would just officially document RMM to be supported on the AEM CS side.

I think that every other question raised in this thread is a discussion on its own:

  • When to use RMM vs RM
  • Are these 2 features adressing a very similar problem really required?

@kwin @YegorKozlov any objections?

@kwin
Copy link
Contributor

kwin commented Sep 26, 2024

Merging this PR makes sense after a release containing the code changes, not before. Apart from that I agree.

@YegorKozlov
Copy link
Contributor

Merging this PR makes sense after a release containing the code changes, not before. Apart from that I agree.

do you mean the AEM CS release supporting redirect maps?

@joerghoh I don't mind merging this PR.

@krystiannowak
Copy link
Contributor Author

@davidjgonzalez @SachinMali FYI

@davidjgonzalez davidjgonzalez merged commit 8ff115d into Adobe-Consulting-Services:master Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants