Less htmx, More HTML: Building Better Websites

2025-04-08

This article shares the author's two-year experience building web services with htmx, arguing for a minimalist approach: prioritize plain HTML over relying heavily on htmx enhancements like `hx-boost`. While `hx-boost` offers seamless page updates, it introduces problems such as conflicts with the browser's back button and disruptions to other libraries. The author advocates using standard HTML links and forms, leveraging browser caching mechanisms (ETags and Cache-Control headers) for efficient updates and a superior user experience. Modern browsers already possess excellent performance optimization capabilities, eliminating the need to over-rely on JavaScript frameworks to mimic SPAs. Only when persistent page state is required (like a music player) should advanced features like `hx-boost` be considered. Ultimately, the author champions the simplicity and reliability of HTML and HTTP for building more maintainable and user-friendly websites.

Development