Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset reloading incorrect after refresh in browser #358

Open
markknol opened this issue Oct 7, 2015 · 0 comments
Open

Asset reloading incorrect after refresh in browser #358

markknol opened this issue Oct 7, 2015 · 0 comments

Comments

@markknol
Copy link
Contributor

markknol commented Oct 7, 2015

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?

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

No branches or pull requests

1 participant