Deal with lexical scope more cleanly for cached non-paginated pages.