improvement: Clarify update detection logging
Besseres Logging zum Verständnis von Cache-Verhalten: - \"✓ Alles aktuell\" = Content + Headers gleich - \"⚙ Metadaten geändert, aber Inhalt gleich\" = Headers unterschiedlich, aber HTML-Inhalt identisch (nur Build-Metadaten/ETag geändert) - \"✅ NEUE VERSION ERKANNT!\" = echter neuer Inhalt entdeckt Hilft zu verstehen, ob GitHub Pages cacht oder ob wirklich eine neue Version deployed wurde. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 4.5
parent
3bc8f984a6
commit
b94f58fcd5
+8
-1
@@ -1214,12 +1214,19 @@ async function checkForUpdates(){
|
|||||||
const headersSame = (etag && etag === storedETag) || (lastModified && lastModified === storedModified);
|
const headersSame = (etag && etag === storedETag) || (lastModified && lastModified === storedModified);
|
||||||
const contentSame = stored && stored === hash;
|
const contentSame = stored && stored === hash;
|
||||||
|
|
||||||
if(headersSame || contentSame){
|
if(contentSame && headersSame){
|
||||||
if(!stored) {
|
if(!stored) {
|
||||||
logUpdate('✓ Erste Prüfung – Hash gespeichert');
|
logUpdate('✓ Erste Prüfung – Hash gespeichert');
|
||||||
} else {
|
} else {
|
||||||
logUpdate('✓ Alles aktuell');
|
logUpdate('✓ Alles aktuell');
|
||||||
}
|
}
|
||||||
|
} else if(contentSame && !headersSame){
|
||||||
|
/* Content gleich, aber Headers geändert – wahrscheinlich nur Build-Metadaten */
|
||||||
|
if(!stored) {
|
||||||
|
logUpdate('✓ Erste Prüfung – Hash gespeichert');
|
||||||
|
} else {
|
||||||
|
logUpdate('⚙ Metadaten geändert, aber Inhalt gleich');
|
||||||
|
}
|
||||||
} else if(stored && !contentSame) {
|
} else if(stored && !contentSame) {
|
||||||
localStorage.setItem('werkbaum-update-available', 'true');
|
localStorage.setItem('werkbaum-update-available', 'true');
|
||||||
logUpdate('✅ NEUE VERSION ERKANNT!');
|
logUpdate('✅ NEUE VERSION ERKANNT!');
|
||||||
|
|||||||
Reference in New Issue
Block a user