Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Out of date content is being served after app version upgrade #591

Open
iamthefox opened this issue Jun 28, 2022 · 0 comments
Open

Out of date content is being served after app version upgrade #591

iamthefox opened this issue Jun 28, 2022 · 0 comments

Comments

@iamthefox
Copy link

Hi,

I am using GCDWebServer in a react-native app to server a static html folder from a bundle.

I am starting a server using:

let websiteroot = Bundle.main.path(forResource: "www", ofType: nil)!;
    webServer.addGETHandler(forBasePath: "/", directoryPath: websiteroot, indexFilename: "index.html", cacheAge: 0, allowRangeRequests: false)

try webServer.start(options: [
            GCDWebServerOption_Port: 8080,
            GCDWebServerOption_BindToLocalhost: true,
            GCDWebServerOption_AutomaticallySuspendInBackground: true])

It works fine and serves html correctly up to the point where I update the app (via appstore or manually).

After update it keeps serving static html content from a previous build instead of a new one.

Is this expected behaviour? If so is it possible to kill a server and serve new content?

Currently the only way around it is to uninstall app and install a fresh one in order to receive latest html.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant