LightHouse efficient cache policy on static assets #16

Open
opened 2021-07-15 13:44:43 +02:00 by bprieshof · 0 comments
bprieshof commented 2021-07-15 13:44:43 +02:00 (Migrated from 192.168.2.138:3000)

Testing required

Fix For for frontcontroller

add following to nginx siteconf

location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff)$ {
    expires 1M;
    access_log off;
    # max-age must be in seconds
    add_header Cache-Control "max-age=2629746, public";
}

location ~* \.(?:css|js)$ {
    expires 1y;
    access_log off;
    add_header Cache-Control "max-age=31556952, public";
}
Testing required Fix For for frontcontroller add following to nginx siteconf ``` location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|mp3|ogg|ogv|webm|htc|woff2|woff)$ { expires 1M; access_log off; # max-age must be in seconds add_header Cache-Control "max-age=2629746, public"; } location ~* \.(?:css|js)$ { expires 1y; access_log off; add_header Cache-Control "max-age=31556952, public"; } ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Work_Archive/VPS-scripts_Web-V2#16