Skip to content

TMJ files are cached for 24 hours during development, changes not picked up #106

@jannikbest

Description

@jannikbest

Description

When running the dev server, changes to .tmj map files are not picked up by the browser. The map remains stale until the browser cache is manually cleared.

I think, this is caused by the Express static middleware in @workadventure/map-starter-kit-core serving all static files (including .tmj) with maxAge: "1d":

const staticOptions = {
  maxAge: "1d",
  etag: true,
  lastModified: true
};
const staticMiddleware = express.static(".", staticOptions);

The browser caches the TMJ file for 24 hours and never re-requests it from the server, making iterative map development impossible.

Expected behavior

During development, changes to .tmj files should be reflected immediately after a browser reload.

Last working version

I have a repo based on commit c43d94d of the map-starter-kit where this issue does not occur.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions