Caching for vector tiles and CORS

286
1
10-22-2019 06:01 AM
deleted-user-OOe4JK-9Abnm
New Contributor III

Hi,

I started with vector tiles! Vectors are fantastic, but I have got a problem with caching.

I develop on http://locatlhost:3000, test server is https://*******getaccess.no/cpt

Problem: I get a CORS error since both locations share vector caching.

If I open localhost with cleaned cache, everything works perfect. Then I open test server, and map is gone. I get a CORS error (see image). If I zoom in on test-server the map will come up, but just on arеas which was not cached on when I navigated on localhost, and vice versa.

I use 4.13 js API.

0 Kudos
1 Reply
deleted-user-OOe4JK-9Abnm
New Contributor III

This is our solution: server must response with "vary: Origin". Then "Origin" and "access-control-allow-origin" matches. As result there is no CORS problem.

0 Kudos