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

E-Tag in too weak #69

Open
jingsam opened this issue Mar 3, 2017 · 2 comments
Open

E-Tag in too weak #69

jingsam opened this issue Mar 3, 2017 · 2 comments

Comments

@jingsam
Copy link
Collaborator

jingsam commented Mar 3, 2017

in https://github.com/mapbox/node-mbtiles/blob/master/lib/mbtiles.js#L165

headers['ETag'] = mbtiles._stat.size + '-' + Number(mbtiles._stat.mtime);

This E-Tag may be too weak.

@mapsam
Copy link
Contributor

mapsam commented Jan 9, 2018

@jingsam any reason why it's too weak? Suggestions to make it stronger?

@jingsam
Copy link
Collaborator Author

jingsam commented Jan 10, 2018

The ETag is not only too weak, but also incorrect. Weak is that if we have two different mbtiles with same size and mtime, This ETags can not distinguish them. Incorrect is that the ETag should be different if the contents of tiles are different, but this algorithm returns same ETag for all tiles in one mbtiles.

How to fix it? I think just deleted it. Express, nginx, apache all have mechanism to calculate the ETag.

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

2 participants