Skip to content

Asset reloading incorrect after refresh in browser #358

Description

@markknol

I observe a file using a Value<Config> and listen to file-changes to set a new Config.

    // create a config Value
    var gameConfig = getConfig("game.settings", "debug");

    // somewhere else
    function getConfig(fileName:String, assetPackName:String):Value<Config>
    {
        var file = AssetLibraryManager.getFile(fileName, assetPackName);
        inline function parseConfig() return Config.parse(file.toString());
        var value = new Value<Config>(parseConfig());
        file.reloadCount.changed.connect(function(to, from)
        {
            value._ = parseConfig();
        });
        return value;
    }

I notice when I have the asset server open, that a file gets refreshed and I get new Config with new values. This works as expected.

But it goes wrong after I refresh the browser page. Then I get old content of the file. This is weird. I checked both 'assets/debug/game.settings' folder and the build/web/assets/debug/game.settings and both contain the correct file content.

My conclusion is that the asset-server caches the file content and serves the wrong file after a file is "reloaded". Can this be the case, and is there a solution for this?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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