Hi there
I have created a small PoC that works with the cache
API in the Web Workers.
As the documentation states, this would not work in the preview, but it doesn’t work in production for me neither.
Here is the PoC code I created and deployed as a worker:
My expected output would be, when I visit my url. I would get the same
Hello world from cache : <same-timestamp-value>
.
But when I visit my url in several consecutive times (from the same machine, so I expect to be hitting (mostly) the same edge location. But I get outputs like this:
Hello world from cache : 1545739290062
Hello world from cache : 1545739297369
Hello world from cache : 1545739302372
Hello world from cache : 1545739306399
Hello world from cache : 1545739310753
Hello world from cache : 1545739315426
Hello world from cache : 1545739322463
Hello world from cache : 1545739325924
Hello world from cache : 1545739329513
Note : The cf-ray
value seems to be updating constantly, except for the -MAD
suffix (which I assume refers to MADRID
as I am currently located in Spain.
None of the above values is recurring, so am I always hitting another edge location that it recreates a new response every time? Or is there a logical issue in my code? But I ran out of inspiration. Did I miss something from the docs?
Happy Holidays!