Move page preview handling to the server