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

Tile Handling of 204/404 results #1579

Open
cns-solutions-admin opened this issue Aug 30, 2022 · 3 comments
Open

Tile Handling of 204/404 results #1579

cns-solutions-admin opened this issue Aug 30, 2022 · 3 comments
Labels
enhancement New feature or request need more info Further information is requested PR is more than welcomed Extra attention is needed

Comments

@cns-solutions-admin
Copy link
Contributor

Handling of tile results 204/404 could be improved:

  • 404 on tile request: currently error message that not found, continues processing, but tries to reload the tile whenever the tile is needed
  • 204 on tile request: error that invalid image format (0-byte file is always invalid), processing aborted. Tries to reload again whenever needed.

It would be better, if

  • 204 is handled as no-data-available (e.g. no terrain available): this fact should also be stored in the source cache to avoid reloading
  • 404 on tile requests are not retried (for some time), if at least one tile for that source was already successfully loaded.

(detected by #1551)

maplibre-gl-js version:
2.3.0

browser:
browser-independent

Steps to Trigger Behavior

With a layer whose tile source does not contain all tiles

  1. zoom in, watch for missing tiles (in browser network monitor)
  2. zoom out, zoom in again at same spot => available tiles are not reloaded, tiles having returned 204/404 are retried again.

Link to Demonstration

E.g. https://maplibre.org/maplibre-gl-js-docs/example/3d-terrain/

Expected Behavior

No invalid-format error messages for tile results 204
204/404 results are cached for some time and not reloaded each time

Actual Behavior

Invalid-format error message for tile result 204
Tile requests returning 204/404 are retried again, whenever that tile is needed (e.g. zoom out/in again)

@HarelM
Copy link
Collaborator

HarelM commented Aug 30, 2022

What's the difference between this issue and #1551? Are both tracking the same problem?

@HarelM HarelM added enhancement New feature or request PR is more than welcomed Extra attention is needed need more info Further information is requested labels Aug 30, 2022
@cns-solutions-admin
Copy link
Contributor Author

This describes an improved handling of tile responses and caching.

#1551 describes a specific problem that might be solved by the improved 204-response handling of this issue.

cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Aug 30, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 1, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 1, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
cns-solutions-admin added a commit to CNS-Solutions/maplibre-gl-js that referenced this issue Sep 21, 2022
@HarelM
Copy link
Collaborator

HarelM commented Nov 19, 2023

There's an open PR which is waiting for code review comments I believe:

I've also refactored the a lot of code around the sources and workers and there's a specific way to handle 404, feel free to add the relevant logic there:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request need more info Further information is requested PR is more than welcomed Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants