i am not sure about this extra query for every page that is not under the cms path... maybe check that the url is below pages-root or make it lazy? actually make it lazy