Optimized html and resource loading