johnbintz/rack-livereload

Don't reload the page on a POST

Closed this issue · 2 comments

When the current page was loaded from a POST request, there's no good way for LiveReload to reload the page. This often comes up when I hit a POST action with an error. If something triggers LiveReload, it refreshes the page and my error message and backtrace disappear.

It would be nice if it were disabled on pages which came from POST requests. It would be nicer if only HTML reloading were disabled, but asset reloading were not.

The latter would require much deeper integration with LiveReload than I know how to do, which I certainly don't have time for now. The former, however, should be straightforward to implement. I'm a bit busy with work and other projects, and if you wanted to take a crack at it, you'd just need to add the relevant HTTP method check in lib/rack/livereload/processing_skip_analyzer.rb (and a test for it, of course).

Awesome, looks straightforward. I'm happy to give it a shot, but I'm swamped with work right now too, so we'll see who gets there first. :)