Re:HTMx
by yawaramin on Friday May 26, 2023 @09:27AM
(#36083810)
It's fairly easy. Htmx sends an `HX-Request: true` header with all requests. You can check for the presence of this header and have an if/else in your handler to render a partial or a full page. Or if you want to enable caching you can configure the `Accept` header with a customized content type like `text/html;hx=1`. That way you can set a response header `Vary: Accept` to ensure that caching is correct.
[ Parent
| on HN ]
There are no comments on this comment yet.