CORS issues can be avoided while creating an offline website. The content must be hosted locally by downloading dependencies locally and using relative paths. Cross-Origin request must be avoided. While testing with XHR and Fetch, "file://" must be avoided. A service worker can be used for advanced online behavior. APIs must be used with a CORS proxy. Headers must be set correctly on the local servers.