omdbapi / OMDb-API

The Open Movie Database Bug Tracking
420 stars 21 forks source link

Browser does not cache responses from the api #159

Open josezulu opened 4 years ago

josezulu commented 4 years ago

I can't figure out why the browser is not caching the responses from the api.

Reproduce:

1) Open Chrome or Firefox 2) Open the dev tools 3) Go to the Network tab 4) Press Escape key to open the console (or open from somewhere in the menu)

5) Type the following request, make sure you use your api key number:

6) You should see on the network pane that the request is issued, and in the transfer column it should read x.xx kB

7) Issue the very same request again from the console (press the up arrow and then enter)

8) You should see on the network pane that the request is issued again, and the transfer column should read again x.xx kB. Which means it didn't load the response from the cache, because otherwise it would read cached.

Try the steps above with: fetch("https://www.test-cors.org/")

Your browser should load the second response from the cache.

The api response headers seem to have the correct expires header one hour from modified, so it should load it from the cache. But there are other headers regarding cache control that perhaps are interfering?

I'm not sure where is the issue. Anyone?

omdbapi commented 4 years ago

By default "Disable Cache" is usually checked within the dev tools network pane. Please verify if that is what is causing this issue. Thanks!

josezulu commented 4 years ago

By default "Disable Cache" is usually checked within the dev tools network pane. Please verify if that is what is causing this issue. Thanks!

No, that is not what's causing the issue.

josezulu commented 4 years ago

Can anyone else try to reproduce following the steps I mentioned in my original post?