Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion frontend/docker/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 2 additions & 13 deletions frontend/httpd.conf
Original file line number Diff line number Diff line change
Expand Up @@ -229,23 +229,12 @@ SSLProxyEngine On

<IfModule unixd_module>

# Define development environments
SetEnvIf Host "localhost|127.0.0.1" DEVELOPMENT

# Cache rules for WebNode assets
<LocationMatch "/assets/webnode/pkg/openmina_node_web\.js">
# 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"
</LocationMatch>
<LocationMatch "/assets/webnode/pkg/openmina_node_web_bg\.wasm">
# 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"
</LocationMatch>

# Make sure mod_headers is enabled
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.