optimize header and queue scripts and styles