htmx 4.0 is under construction — migration guide

HX-Refresh

Trigger a full page reload

The HX-Refresh response header, when set to true, reloads the entire page.

Use this when you need to reset all page state after an action.

Example

HX-Refresh: true
return Response( "Changes saved", headers={'HX-Refresh': 'true'} )