diff --git a/composer.json b/composer.json index 922f89a8c..3ab820a1f 100644 --- a/composer.json +++ b/composer.json @@ -40,10 +40,10 @@ "type": "package", "package": { "name": "danskernesdigitalebibliotek/dpl-react", - "version": "2024.38.0", + "version": "2024.38.1", "type": "drupal-library", "dist": { - "url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/2024.38.0/dist-2024-38-0-65e8999aef4dbfa5d8367576aa634a090b83d10b.zip", + "url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/2024.38.1/dist-2024-38-1-a36a48adae0337d3f12539a38d9e5dd2bb4f52fb.zip", "type": "zip" }, "require": { @@ -91,7 +91,7 @@ "cweagans/composer-patches": "1.7.3", "danskernesdigitalebibliotek/cms-api": "*", "danskernesdigitalebibliotek/dpl-design-system": "2024.38.0", - "danskernesdigitalebibliotek/dpl-react": "2024.38.0", + "danskernesdigitalebibliotek/dpl-react": "2024.38.1", "danskernesdigitalebibliotek/fbs-client": "*", "dealerdirect/phpcodesniffer-composer-installer": "^1.0.0", "deoliveiralucas/array-keys-case-transform": "^1.1", diff --git a/composer.lock b/composer.lock index 04f6ace77..fa8dc90b1 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5c9c9a902c2b46d369fe863b6466d44c", + "content-hash": "43f43e6bb984a774a763b86076540106", "packages": [ { "name": "amazeeio/drupal_integrations", @@ -1175,10 +1175,10 @@ }, { "name": "danskernesdigitalebibliotek/dpl-react", - "version": "2024.38.0", + "version": "2024.38.1", "dist": { "type": "zip", - "url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/2024.38.0/dist-2024-38-0-65e8999aef4dbfa5d8367576aa634a090b83d10b.zip" + "url": "https://github.com/danskernesdigitalebibliotek/dpl-react/releases/download/2024.38.1/dist-2024-38-1-a36a48adae0337d3f12539a38d9e5dd2bb4f52fb.zip" }, "require": { "composer/installers": "^1.2.0" diff --git a/lagoon/conf/nginx/server_append_disable_varnish_static_files.conf b/lagoon/conf/nginx/server_append_disable_varnish_static_files.conf new file mode 100644 index 000000000..85226afdb --- /dev/null +++ b/lagoon/conf/nginx/server_append_disable_varnish_static_files.conf @@ -0,0 +1,45 @@ +# Disable Varnish cache for all static files. Nginx will serve them just as quick. +# +# This is based on support for Surrogate-control supported by the Lagoon +# Varnish for Drupal image: +# https://github.com/uselagoon/lagoon-images/blob/main/images/varnish-drupal/drupal.vcl#L356 +# +# Drupal generated and user uploaded files +location ^~ /sites/default/files/ { + add_header Surrogate-Control "no-store" always; + try_files $uri @drupal-files; +} +# External libraries managed by Drupal Core may contain static files. +location ^~ /core/assets/vendor/ { + add_header Surrogate-control "no-store" always; +} +# External libraries may contain static files. +location ^~ /libraries/ { + add_header Surrogate-control "no-store" always; +} +# Static files from the theme which will not be bundled by Drupal e.g. +# fonts and icons. +location ^~ /themes/custom/novel/assets/dpl-design-system/ { + add_header Surrogate-control "no-store" always; +} + +# Duplicate of upstrean @drupal location provided by the Lagoon Nginx image for +# for Drupal. +# https://github.com/uselagoon/lagoon-images/blob/main/images/nginx-drupal/drupal.conf#L72 +# +# This is needed to add an additional response header to files generated by +# Drupal at runtime. Once the file is generated then the existing location will +# take precedence but if does not then try_files will issue an internal +# redirect which requires the headers to be set again. +location @drupal-files { + include /etc/nginx/conf.d/drupal/location_drupal_prepend*.conf; + + include /etc/nginx/fastcgi.conf; + fastcgi_param SCRIPT_NAME /index.php; + fastcgi_param SCRIPT_FILENAME $realpath_root/index.php; + fastcgi_pass ${NGINX_FASTCGI_PASS:-php}:9000; + + add_header Surrogate-control "no-store" always; + + include /etc/nginx/conf.d/drupal/location_drupal_append*.conf; +} diff --git a/lagoon/nginx.dockerfile b/lagoon/nginx.dockerfile index 35fc2c286..8532b376a 100644 --- a/lagoon/nginx.dockerfile +++ b/lagoon/nginx.dockerfile @@ -8,6 +8,9 @@ COPY --from=cli /app /app COPY lagoon/conf/nginx/location_prepend_drupal_authorize.conf /etc/nginx/conf.d/drupal/location_prepend_drupal_authorize.conf RUN fix-permissions /etc/nginx/conf.d/drupal/location_prepend_drupal_authorize.conf +COPY lagoon/conf/nginx/server_append_disable_varnish_static_files.conf /etc/nginx/conf.d/drupal/server_append_disable_varnish_static_files.conf +RUN fix-permissions /etc/nginx/conf.d/drupal/server_append_disable_varnish_static_files.conf + COPY lagoon/conf/nginx/server_append_drupal_authorize.conf /etc/nginx/conf.d/drupal/server_append_drupal_authorize.conf RUN fix-permissions /etc/nginx/conf.d/drupal/server_append_drupal_authorize.conf