Skip to content

Conversation

@am2222
Copy link

@am2222 am2222 commented Jul 9, 2024

This PR adds a cache-id query parameter to the tiles url. This helps to refresh client side cache when we update mbtiles on the server as its file hash changes and browser invalidates older caches

  • if file is mbtile it uses fileHash

  • if file is pmtiles it uses mtime (last modified time)

  • I need some more information about the tests. On my machine I was not able to run tests as it was missing test data folder. is there any way I can access them?
    Thanks

@am2222 am2222 mentioned this pull request Jul 9, 2024
}
} else if (inputType === 'mbtiles') {
sourceType = 'mbtiles';
tileJSON['cacheId']= await getFileHash(inputFile)

Check notice

Code scanning / CodeQL

Semicolon insertion

Avoid automated semicolon insertion (96% of all statements in [the enclosing function](1) have an explicit semicolon).
rs.on('error', reject);
rs.on('data', chunk => hash.update(chunk));
rs.on('end', () => resolve(hash.digest('base64')));
})

Check notice

Code scanning / CodeQL

Semicolon insertion

Avoid automated semicolon insertion (90% of all statements in [the enclosing script](1) have an explicit semicolon).
@acalcutt
Copy link
Collaborator

acalcutt commented Jul 9, 2024

For the test data, there is a link to it here https://github.com/maptiler/tileserver-gl?tab=readme-ov-file#getting-started-with-linux-cli under "Test from command line"

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

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants