Skip to content

Commit fa0e2d6

Browse files
authored
Disable service worker by default (#18914)
The service worker causes a lot of issues with JS errors after instance upgrades while not bringing any real performance gain over regular HTTP caching. Disable it by default for this reason. Maybe later we can remove it completely, as I simply see no benefit in having it.
1 parent 5b0cdd6 commit fa0e2d6

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

custom/conf/app.example.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1115,7 +1115,7 @@ PATH =
11151115
;SEARCH_REPO_DESCRIPTION = true
11161116
;;
11171117
;; Whether to enable a Service Worker to cache frontend assets
1118-
;USE_SERVICE_WORKER = true
1118+
;USE_SERVICE_WORKER = false
11191119

11201120
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
11211121
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ The following configuration set `Content-Type: application/vnd.android.package-a
189189
add it to this config.
190190
- `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.
191191
- `SEARCH_REPO_DESCRIPTION`: **true**: Whether to search within description at repository search on explore page.
192-
- `USE_SERVICE_WORKER`: **true**: Whether to enable a Service Worker to cache frontend assets.
192+
- `USE_SERVICE_WORKER`: **false**: Whether to enable a Service Worker to cache frontend assets.
193193

194194
### UI - Admin (`ui.admin`)
195195

docs/content/doc/developers/hacking-on-gitea.en-us.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,6 @@ Before committing, make sure the linters pass:
185185
make lint-frontend
186186
```
187187

188-
Note: When working on frontend code, set `USE_SERVICE_WORKER` to `false` in `app.ini` to prevent undesirable caching of frontend assets.
189-
190188
### Configuring local ElasticSearch instance
191189

192190
Start local ElasticSearch instance using docker:

modules/setting/setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1042,7 +1042,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
10421042
UI.ShowUserEmail = Cfg.Section("ui").Key("SHOW_USER_EMAIL").MustBool(true)
10431043
UI.DefaultShowFullName = Cfg.Section("ui").Key("DEFAULT_SHOW_FULL_NAME").MustBool(false)
10441044
UI.SearchRepoDescription = Cfg.Section("ui").Key("SEARCH_REPO_DESCRIPTION").MustBool(true)
1045-
UI.UseServiceWorker = Cfg.Section("ui").Key("USE_SERVICE_WORKER").MustBool(true)
1045+
UI.UseServiceWorker = Cfg.Section("ui").Key("USE_SERVICE_WORKER").MustBool(false)
10461046

10471047
HasRobotsTxt, err = util.IsFile(path.Join(CustomPath, "robots.txt"))
10481048
if err != nil {

0 commit comments

Comments
 (0)