Page 4: HTTPS/Security and Lighthouse Audit

4. HTTPS/Security and Lighthouse Audit

HTTPS is mandatory for your PWA to be recognized as secure by the browser and to allow Service Workers to function. You must also use Google Lighthouse to verify that you meet the PWA criteria.

4.1. Importance of HTTPS

Because Service Workers have the powerful ability to intercept and modify network requests, they must only be registered and executed over HTTPS to prevent man-in-the-middle attacks. The localhost environment is an exception.

// Ensure your Service Worker is running in an HTTPS environment when deployed.
// If the Service Worker fails to register, HTTPS setup is the first thing to check.

4.2. Quality Verification via Lighthouse Audit

Use the Lighthouse tab in Chrome DevTools to audit your PWA\'s performance, accessibility, and compliance with PWA standards. Aim for a PWA score of 70 or higher.