diff --git a/deploy/README.md b/deploy/README.md index 54f77ab..befabdd 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -104,6 +104,8 @@ Notes: - Replace `yourdomain.com` with your real domain. - Script copies `deploy/apache/chgrid-vhost-snippet.conf`, runs `rebuildhttpdconf`, then restarts Apache via WHM restart command. - Snippet now includes no-cache headers for `/chgrid/` and `/chgrid/index.html` so client updates are not stuck on stale HTML. +- `deploy_client.sh` also installs `/chgrid/.htaccess` from `deploy/apache/chgrid-public-htaccess` + to force no-cache on `index.html` and `version.js` in shared-host setups. ## 7) Optional HTTPS relay for HTTP radio streams diff --git a/deploy/apache/chgrid-public-htaccess b/deploy/apache/chgrid-public-htaccess new file mode 100644 index 0000000..16f039f --- /dev/null +++ b/deploy/apache/chgrid-public-htaccess @@ -0,0 +1,10 @@ +# Chat Grid publish-dir cache policy. +# Applied to /chgrid/.htaccess by deploy_client.sh. + + + + Header set Cache-Control "no-store, no-cache, must-revalidate" + Header set Pragma "no-cache" + Header set Expires "0" + + diff --git a/deploy/scripts/deploy_client.sh b/deploy/scripts/deploy_client.sh index 730aed1..d40cc9a 100755 --- a/deploy/scripts/deploy_client.sh +++ b/deploy/scripts/deploy_client.sh @@ -6,6 +6,7 @@ PUBLISH_DIR="${2:-/home/bestmidi/public_html/chgrid}" BASE_PATH="${3:-/chgrid/}" CLIENT_DIR="$REPO_ROOT/client" PHP_PROXY_DIR="$REPO_ROOT/deploy/php" +PUBLIC_HTACCESS_SRC="$REPO_ROOT/deploy/apache/chgrid-public-htaccess" if [[ ! -d "$CLIENT_DIR" ]]; then echo "error: client directory not found: $CLIENT_DIR" >&2 @@ -28,6 +29,10 @@ if [[ -d "$PHP_PROXY_DIR" ]]; then rsync -a "$PHP_PROXY_DIR/" "$PUBLISH_DIR/" fi +if [[ -f "$PUBLIC_HTACCESS_SRC" ]]; then + cp "$PUBLIC_HTACCESS_SRC" "$PUBLISH_DIR/.htaccess" +fi + # Normalize publish permissions for restrictive shared-host PHP handlers. # - Directories must be executable/traversable. # - PHP/static files must not be group-writable.