NGSW Config File

Each named groups can choose two caching strategies

NGSW assetGroups


        interface AssetGroup {
            name: string;
            installMode?: 'prefetch' | 'lazy';
            updateMode?: 'prefetch' | 'lazy';
            resources: {
                files?: string[];
                versionedFiles?: string[];
                urls?: string[];
            };
        }
    

NGSW dataGroups


        export interface DataGroup {
            name: string;
            urls: string[];
            version?: number;
            cacheConfig: {
                maxSize: number;
                maxAge: string;
                timeout?: string;
                strategy?: 'freshness' | 'performance';
            };
        }
    

NGSW Resource Patterns


        # all files
        "https://localhost:3002/**" 

        # specifies all JSON files
        "https://localhost:3002/**/*.json"

        # specifies only HTML files in the root
        "https://localhost:3002/*.html" 

        # exclude all sourcemaps
        "!https://localhost:3002/**/*.map"