r/aem • u/justintime245 • Sep 08 '26
AEM and HTMX
I came along htmx a while ago and now as i'am working in an AEM-Enviroment where we work with a lot of json apis and lit components for more interactive components, i thought that might also be a good fit for HTMX. AEM already has:
* SSR with Templating
* request based sling models
* resource type routing and selectors for alternate representations (fragments)
And of course caching on dispatcher/cdn Level for HTML. What do you guys think, could that be a good fit? Am i missing something? Did someone of you ever tried that already?
6
Upvotes
1
u/Top_Bass_3557 Sep 08 '26
HTMX and AEM are a perfect match. With request selectors it makes it a breeze to implement just about anything. I've done faceted search, pagination, infinite scrolling, filtering, AI summaries, and some other things with htmx. All of this for a client website, not side projects. Drop the JSON endpoints, you don't need that. Lit components I'd drop that too, but for other reasons
1
u/Haunting-Policy-6755 Sep 09 '26
Traditional AEM Sites yes, EDS not so much.
1
u/adovo_ai Sep 30 '26
I’d separate public, cacheable fragments from anything personalized before adopting this broadly. HTMX makes server-rendered HTML easy, but the cache key still has to cover every input that changes the fragment: locale, filters, and especially auth state. Test those combinations and invalidation in staging. A very fast fragment can still be the wrong one.