Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.
This repository was 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

@iamthefox

Description

@iamthefox

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions