Add function to pre-cache views