diff --git a/frontend/docker/startup.sh b/frontend/docker/startup.sh index 98378a56fc..19b2629a10 100644 --- a/frontend/docker/startup.sh +++ b/frontend/docker/startup.sh @@ -120,7 +120,6 @@ inject_caching_logic() { # Generate a unique hash local hash=$(openssl rand -hex 8) - sed -i "/module_or_path = fetch(module_or_path);/i\ module_or_path += \"\?v=${hash}\";" "$js_file" sed -i 's/module_or_path = fetch(module_or_path);/module_or_path = fetch(module_or_path, { cache: "force-cache", headers: { "Cache-Control": "max-age=31536000, immutable" } });/' "$js_file" if [[ $? -ne 0 ]]; then echo "Failed to inject caching logic into $js_file" diff --git a/frontend/httpd.conf b/frontend/httpd.conf index e6c0570e75..c294365780 100644 --- a/frontend/httpd.conf +++ b/frontend/httpd.conf @@ -229,23 +229,12 @@ SSLProxyEngine On -# Define development environments -SetEnvIf Host "localhost|127.0.0.1" DEVELOPMENT - # Cache rules for WebNode assets - # Development environment - no cache - Header set Cache-Control "no-store, no-cache, must-revalidate" env=DEVELOPMENT - - # Production environment - aggressive caching - Header set Cache-Control "public, max-age=31536000, immutable" env=!DEVELOPMENT + Header set Cache-Control "public, max-age=31536000, immutable" - # Development environment - no cache - Header set Cache-Control "no-store, no-cache, must-revalidate" env=DEVELOPMENT - - # Production environment - aggressive caching - Header set Cache-Control "public, max-age=31536000, immutable" env=!DEVELOPMENT + Header set Cache-Control "public, max-age=31536000, immutable" # Make sure mod_headers is enabled diff --git a/frontend/src/index.html b/frontend/src/index.html index b6768d9bf3..d86532cf85 100644 --- a/frontend/src/index.html +++ b/frontend/src/index.html @@ -45,7 +45,7 @@ // Get version from build-time replaced variable or from meta tag // This will be replaced during build (don't change this line!!) const WEBNODE_VERSION = '13b85f46d3496a8608a86c8af21374bf'; - const webNodeUrl = `./assets/webnode/pkg/openmina_node_web.js?v=${WEBNODE_VERSION}`; + const webNodeUrl = `./assets/webnode/pkg/openmina_node_web.js`; import(webNodeUrl) .then((v) => {