Skip to content

Commit 61c7732

Browse files
authored
Disable service worker by default (#18914) (#19342)
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 57c2ca7 commit 61c7732

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
@@ -1075,7 +1075,7 @@ PATH =
10751075
;SEARCH_REPO_DESCRIPTION = true
10761076
;;
10771077
;; Whether to enable a Service Worker to cache frontend assets
1078-
;USE_SERVICE_WORKER = true
1078+
;USE_SERVICE_WORKER = false
10791079

10801080
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
10811081
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

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
### Building and adding SVGs
191189

192190
SVG icons are built using the `make svg` target which compiles the icon sources defined in `build/generate-svg.js` into the output directory `public/img/svg`. Custom icons can be added in the `web_src/svg` directory.

modules/setting/setting.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1010,7 +1010,7 @@ func loadFromConf(allowEmpty bool, extraConfig string) {
10101010
UI.ShowUserEmail = Cfg.Section("ui").Key("SHOW_USER_EMAIL").MustBool(true)
10111011
UI.DefaultShowFullName = Cfg.Section("ui").Key("DEFAULT_SHOW_FULL_NAME").MustBool(false)
10121012
UI.SearchRepoDescription = Cfg.Section("ui").Key("SEARCH_REPO_DESCRIPTION").MustBool(true)
1013-
UI.UseServiceWorker = Cfg.Section("ui").Key("USE_SERVICE_WORKER").MustBool(true)
1013+
UI.UseServiceWorker = Cfg.Section("ui").Key("USE_SERVICE_WORKER").MustBool(false)
10141014

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

0 commit comments

Comments
 (0)