http
HTTP/2 200 OK
Content-Type: text/html
Content-Security-Policy: worker-src 'self' https://workers.example.com; script-src 'self'
<!DOCTYPE html>
<html>
<script>
// Web Worker für CPU-intensive API-Response-Transformation
const dataWorker = new Worker('/workers/transform-data.js'); // OK ('self')
dataWorker.postMessage({apiData: {...}});
// Shared Worker für Cross-Tab-API-State-Synchronisation
const syncWorker = new SharedWorker('https://workers.example.com/sync.js'); // OK (whitelisted)
syncWorker.port.start();
// Service Worker für API-Response-Caching
navigator.serviceWorker.register('/workers/cache-strategy.js'); // OK ('self')
// API-Aufruf mit Worker-basiertem Processing
fetch('/api/large-dataset')
.then(r => r.json())
.then(data => dataWorker.postMessage({action: 'process', data}));
</script>
</html>