Lps 36277 allow markup head ajax render

@juliocamarero this one is very similar to 	https://github.com/ipeychev/liferay-portal-ee/pull/13 but applied to master.

Unfortunately, master requires https://github.com/shuyangzhou/liferay-portal/pull/331to be solved