Issue #1998434 by mjpa: Remove ajaxPageState settings if they're not needed.