Repository navigation
webui: rely on the HTTP cache headers instead of cache busting - #157
Conversation
The WebUI tried to avoid stale browser caches in several ad hoc ways: _version_ and AvoidBrowserCache URL parameters, cache: false in jQuery requests and cache-control meta tags (also emitted by put_meta_nocache in the device parameter pages). These either did not help after an update or prevented caching altogether. Remove them, and rely on the Cache-Control response headers of the web server, which let browsers revalidate the files with ETags. The update dialog no longer asks to clear the browser cache after an update. The EULA is loaded with cache: false, and the version checks against the eQ-3 servers get a timestamp parameter because their responses are not under the control of the local web server.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (17)
💤 Files with no reviewable changes (7)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Web UI removes several no-cache directives and cache-busting parameters. Some AJAX cache settings and profile parameter handling also change. Homematic firmware requests add timestamp parameters. The firmware-update progress message no longer includes its update-step text. ChangesWeb UI cache handling
Firmware update progress message
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~12 minutes Change: Bug fix Merge Risk: ⚪ Minimal · up to Local WebUI resources will rely on response revalidation instead of cache-busting URLs. No concrete regression was established in the changed paths, so the merge risk is minimal. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)✅ Passed checks (4 passed)Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
This removes OpenCCU rootfs patch 0026-WebUI-Fix-CacheControl.patch, now that OpenCCU/OpenCCU-Base#157 is merged.
Original OpenCCU rootfs patch: 0026
Original filename:
0026-WebUI-Fix-CacheControl.patchOriginal patch: https://github.com/OpenCCU/OpenCCU/blob/fa019f34f/buildroot-external/package/openccu-base/rootfs-patches/0026-WebUI-Fix-CacheControl.patch
Original changes: OpenCCU/OpenCCU@165dc091f (OpenCCU/OpenCCU#245) and OpenCCU/OpenCCU@12c017c26
The WebUI tried to avoid stale browser caches in several ad hoc ways:
_version_andAvoidBrowserCacheURL parameters,cache: falsein jQuery requests, and cache-control meta tags (also emitted byput_meta_nocachein the device parameter pages). These either did not help after an update or prevented caching altogether. OpenCCU instead sendsCache-Control: private, no-cache, must-revalidate, no-transform, max-age=0for non-image files (max-age=120for images) from its lighttpd configuration, so browsers revalidate with ETags. ReGaHss itself answers withCache-Control: no-store, no-cache.This is the second of three migrations that depend on each other: 0002 (Bootstrap, #155) is in, and 0036 (favicons) uses context lines changed here.
This applies the patch 1:1:
src/webui/rega/www/login.htm,logout.htm,pages/index.htm,index.htm,src/webui/www/error/error-500.html,error-503.html,src/webui/www/tools/designer.html: no_version_parameters and no cache-control meta tags.src/webui/www/tools/js/common/httploader.jsandsrc/webui/www_source/webui/js/common/httploader.js: no_version_parameter (addVersion()removed).src/webui/www_source/config/js/ic_common.js: noAvoidBrowserCacheparameter.src/webui/www/config/ic_common.tclandic_neweasymode.cgino longer list it inIGNORE_PARAMS. In this repository it was only added by this function.src/webui/www/config/ic_common.tcl:put_meta_nocacheis removed together with all its callers (ic_common.tcl,ic_ifacecmd.cgi); no other caller exists in this repository.src/webui/www/webui/js/lang/loadTextResource.jsandsrc/webui/www_source/webui/js/headerbar.js: nocache: false(the language files are still executed as scripts, jQuery detects them by theirapplication/javascriptcontent type).src/webui/www_source/webui/js/homematic.com.js: the version and firmware checks against the eQ-3 servers get ats=<Date.now()>parameter, because their responses are not under the control of the local web server.src/webui/www/config/cp_maintenance.cgi: the EULA request usescache: false, and the software update dialog no longer asks to clear the browser cache after the update (dialogSettingsCMDialogPerformSoftwareUpdateP2/Li1-Li3).webui.jsis assembled fromwww_source, so its five hunks of the rootfs patch are applied tohttploader.js,headerbar.js,homematic.com.js(two hunks) andconfig/js/ic_common.js. Encodings and line endings are preserved (CRLF files:ic_common.tcl,ic_neweasymode.cgi, the error pages,index.htm,tools/js/common/httploader.js, and thewww_sourcefiles exceptconfig/js/ic_common.js). The rootwww/copies are unused legacy files and are left unchanged.Other OpenCCU rootfs patches also modify these files (among them 0001, 0007, 0008, 0012, 0031, 0036, 0119, 0135, 0149, 0154, 0163-0165 and 0173). They still apply with zero fuzz.
Validation
scripts/base-patch-migration.py validatewith the canonical Buildroot 2026.08git4archive of this branch (43d94689, sha2560c2336d85afa6be5496b26898234a125bd363308fffb148bfa188a5dd9d008fd) and--skip-patch 0026: PASS (the other 64 rootfs patches apply with zero fuzz).compareagainst the current pin baseline (b9ce345d, all 65 patches as of build(openccu-base): migrate patch 0002 OpenCCU#4399): IDENTICAL (4668 entries).OpenCCU cleanup PR (removing patch 0026 and updating the pin): OpenCCU/OpenCCU#4403
Generated by Claude Code
Summary by CodeRabbit
Generated by Claude Code