Environment detection and view cache