mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	This should solve the main problem of dynamic assets getting stale after a version upgrade. Everything not affected will use query-string based cache busting, which includes files loaded via HTML or worker scripts.
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
import $ from 'jquery';
 | 
			
		||||
 | 
			
		||||
const {appSubUrl, csrfToken, notificationSettings} = window.config;
 | 
			
		||||
const {appSubUrl, csrfToken, notificationSettings, assetVersionEncoded} = window.config;
 | 
			
		||||
let notificationSequenceNumber = 0;
 | 
			
		||||
 | 
			
		||||
export function initNotificationsTable() {
 | 
			
		||||
@@ -59,7 +59,7 @@ export function initNotificationCount() {
 | 
			
		||||
 | 
			
		||||
  if (notificationSettings.EventSourceUpdateTime > 0 && window.EventSource && window.SharedWorker) {
 | 
			
		||||
    // Try to connect to the event source via the shared worker first
 | 
			
		||||
    const worker = new SharedWorker(`${__webpack_public_path__}js/eventsource.sharedworker.js`, 'notification-worker');
 | 
			
		||||
    const worker = new SharedWorker(`${__webpack_public_path__}js/eventsource.sharedworker.js?v=${assetVersionEncoded}`, 'notification-worker');
 | 
			
		||||
    worker.addEventListener('error', (event) => {
 | 
			
		||||
      console.error('worker error', event);
 | 
			
		||||
    });
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user