]> git.proxmox.com Git - pmg-gui.git/commitdiff
add browser cache workaround
authorDominik Csapak <d.csapak@proxmox.com>
Thu, 28 Nov 2019 10:22:44 +0000 (11:22 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 28 Nov 2019 10:29:05 +0000 (11:29 +0100)
to prevent indefinite caching of the js files in the browser,
we add the package version to the js files, this will be read
by the pmgproxy and added as template variables

we use those to add the version to the get parameter and
thus tell the browser the file has changed

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Makefile
js/Makefile
pmg-index.html.tt

index 794c7b6f8fd2c877f3693220867e01c4ace75bc0..b5ba9d45c5a9c6304098a12433042bd5c92cc88b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -19,6 +19,8 @@ IMAGES=                               \
 
 CSSFILES = ext6-pmg.css ext6-pmg-mobile.css
 
+export DEB_VERSION_UPSTREAM_REVISION
+
 all:
 
 .PHONY: deb
index e0ac0268f78a87e5551c277293be86a30b72a28e..353062c9d4c688635c9410c8b2c6e805bd314d5b 100644 (file)
@@ -106,7 +106,8 @@ lint: ${JSSRC}
        jslint ${JSSRC} 
 
 pmgmanagerlib.js: OnlineHelpInfo.js ${JSSRC}
-       cat OnlineHelpInfo.js ${JSSRC} >$@.tmp
+       echo "// ${DEB_VERSION_UPSTREAM_REVISION}" > $@.tmp
+       cat OnlineHelpInfo.js ${JSSRC} >> $@.tmp
        mv $@.tmp $@
 
 pmgmanagerlib-mobile.js: ${MOBILESRC}
index 20fa45409324436253018ad2a2ed91c2f48eac23..4faf0cf3c0c6ad9b9f5490367aaa8679680fd00d 100644 (file)
@@ -11,8 +11,8 @@
     <link rel="stylesheet" type="text/css" href="/pve2/ext6/theme-crisp/resources/theme-crisp-all.css" />
     <link rel="stylesheet" type="text/css" href="/pve2/ext6/crisp/resources/charts-all.css" />
     <link rel="stylesheet" type="text/css" href="/fontawesome/css/font-awesome.css" />
-    <link rel="stylesheet" type="text/css" href="/pve2/css/ext6-pmg.css" />
-    <link rel="stylesheet" type="text/css" href="/pwt/css/ext6-pmx.css" />
+    <link rel="stylesheet" type="text/css" href="/pve2/css/ext6-pmg.css?ver=[% version %]" />
+    <link rel="stylesheet" type="text/css" href="/pwt/css/ext6-pmx.css?ver=[% wtversion %]" />
     [% IF langfile %]
     <script type='text/javascript' src='/pve2/locale/pmg-lang-[% lang %].js'></script>
     [% ELSE %]
         CSRFPreventionToken: '[% token %]'
       };
     </script>
-    <script type="text/javascript" src="/proxmoxlib.js"></script>
+    <script type="text/javascript" src="/proxmoxlib.js?ver=[% wtversion %]"></script>
     <script type="text/javascript" src="/pve2/ext6/locale/locale-[% lang %].js"></script>
     <script type="text/javascript">
       Ext.History.fieldid = 'x-history-field';
     </script>
-    <script type="text/javascript" src="/pve2/js/pmgmanagerlib.js"></script>
+    <script type="text/javascript" src="/pve2/js/pmgmanagerlib.js?ver=[% version %]"></script>
   </head>
   <body>
     <!-- Fields required for history management -->