Skip to content

Commit 50bd7d0

Browse files
authored
Remove the service worker (go-gitea#25010)
It's been disabled by default since 1.17 (go-gitea#18914), and it never really delivered any benefit except being another cache layer that has its own unsolved invalidation issues. HTTP cache works, we don't need two cache layers at the browser for assets. ## ⚠️ BREAKING You can remove the config `[ui].USE_SERVICE_WORKER` from your `app.ini` now.
1 parent 28a89e3 commit 50bd7d0

File tree

15 files changed

+3
-128
lines changed

15 files changed

+3
-128
lines changed

.dockerignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ cpu.out
7676
/yarn-error.log
7777
/npm-debug.log*
7878
/public/js
79-
/public/serviceworker.js
8079
/public/css
8180
/public/fonts
8281
/public/img/webpack

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ cpu.out
7777
/yarn-error.log
7878
/npm-debug.log*
7979
/public/js
80-
/public/serviceworker.js
8180
/public/css
8281
/public/fonts
8382
/public/img/webpack

.ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
*.min.css
22
*.min.js
3+
/assets/*.json
34
/modules/options/bindata.go
45
/modules/public/bindata.go
56
/modules/templates/bindata.go

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ FOMANTIC_WORK_DIR := web_src/fomantic
114114
WEBPACK_SOURCES := $(shell find web_src/js web_src/css -type f)
115115
WEBPACK_CONFIGS := webpack.config.js
116116
WEBPACK_DEST := public/js/index.js public/css/index.css
117-
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack public/serviceworker.js
117+
WEBPACK_DEST_ENTRIES := public/js public/css public/fonts public/img/webpack
118118

119119
BINDATA_DEST := modules/public/bindata.go modules/options/bindata.go modules/templates/bindata.go
120120
BINDATA_HASH := $(addsuffix .hash,$(BINDATA_DEST))

custom/conf/app.example.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1208,9 +1208,6 @@ LEVEL = Info
12081208
;; Whether to search within description at repository search on explore page.
12091209
;SEARCH_REPO_DESCRIPTION = true
12101210
;;
1211-
;; Whether to enable a Service Worker to cache frontend assets
1212-
;USE_SERVICE_WORKER = false
1213-
;;
12141211
;; Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used.
12151212
;; A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic).
12161213
;ONLY_SHOW_RELEVANT_REPOS = false

docs/content/doc/administration/config-cheat-sheet.en-us.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,6 @@ The following configuration set `Content-Type: application/vnd.android.package-a
230230
add it to this config.
231231
- `DEFAULT_SHOW_FULL_NAME`: **false**: Whether the full name of the users should be shown where possible. If the full name isn't set, the username will be used.
232232
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
233-
- `USE_SERVICE_WORKER`: **false**: Whether to enable a Service Worker to cache frontend assets.
234233
- `ONLY_SHOW_RELEVANT_REPOS`: **false** Whether to only show relevant repos on the explore page when no keyword is specified and default sorting is used.
235234
A repo is considered irrelevant if it's a fork or if it has no metadata (no description, no icon, no topic).
236235

modules/setting/ui.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ var UI = struct {
3232
CustomEmojis []string
3333
CustomEmojisMap map[string]string `ini:"-"`
3434
SearchRepoDescription bool
35-
UseServiceWorker bool
3635
OnlyShowRelevantRepos bool
3736

3837
Notification struct {
@@ -136,7 +135,6 @@ func loadUIFrom(rootCfg ConfigProvider) {
136135
UI.ShowUserEmail = sec.Key("SHOW_USER_EMAIL").MustBool(true)
137136
UI.DefaultShowFullName = sec.Key("DEFAULT_SHOW_FULL_NAME").MustBool(false)
138137
UI.SearchRepoDescription = sec.Key("SEARCH_REPO_DESCRIPTION").MustBool(true)
139-
UI.UseServiceWorker = sec.Key("USE_SERVICE_WORKER").MustBool(false)
140138

141139
// OnlyShowRelevantRepos=false is important for many private/enterprise instances,
142140
// because many private repositories do not have "description/topic", users just want to search by their names.

modules/templates/helper.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,6 @@ func NewFuncMap() template.FuncMap {
127127
"MetaKeywords": func() string {
128128
return setting.UI.Meta.Keywords
129129
},
130-
"UseServiceWorker": func() bool {
131-
return setting.UI.UseServiceWorker
132-
},
133130
"EnableTimetracking": func() bool {
134131
return setting.Service.EnableTimetracking
135132
},

package-lock.json

Lines changed: 0 additions & 23 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@
5151
"vue3-calendar-heatmap": "2.0.5",
5252
"webpack": "5.84.1",
5353
"webpack-cli": "5.1.1",
54-
"workbox-routing": "6.6.0",
55-
"workbox-strategies": "6.6.0",
5654
"wrap-ansi": "8.1.0"
5755
},
5856
"devDependencies": {

0 commit comments

Comments
 (0)