CORS request won’t trigger making cache?
-
Hi there, I found that a CORS request make by the fetch seems like won’t trigger the cache to be made?
I have set the these headers to make sure cors will work
access-control-allow-headers: Authorization, Content-Type access-control-allow-origin: *and in the settings panel I have set “Force Public Cache URIs” to
^/graphqlyes, it gets a response with 200 status code, but the payload is empty, not even a single letter. I can confirm that the response header with
x-litespeed-cache:hitwhich shows it is a cached response, but with no contents.I could confirm that it works if I just copy and paste the request URL made by the
fetchto the browser’s address bar(which means it works with the same domain).The
fetchwill send aOPTIONSrequest before it can send aGETrequest, so I’m guessing maybe LiteSpeed cached theOPTIONSrequest instead ofGETrequest..?I’m making an API request(GET method) from another domain to an end point of the domain which using this plugin. I want to know if this is a bug or intended?
The topic ‘CORS request won’t trigger making cache?’ is closed to new replies.