I have a simple situation. I am using jQuery's ajax method to get some data.
When I refer to "api.json" in url, I get proper response headers with etag, cache-control etc etc. The content-type is also "application/json"
But when I refer to a "api.php" in url, the response header changes, this time there is no etag, no cache-control and content-type is also "text/html" ( which is understood ).
In that php file the returned data is properly formatted using json_encode().
What I do not understand is, why etag and other caching headers are misbehaving?
How can I enable them to cache properly?
The ETag header present in cross-origin responses will not be accessible to client-side code unless the server includes an Access-Control-Expose-Headers header in its response, with a value of "ETag". This is true of any "non-simple" response headers.
From CORS
7.1.1 Handling a Response to a Cross-Origin Request User agents must filter out all response headers other than those that are a simple response header or of which the field name is an ASCII case-insensitive match for one of the values of the Access-Control-Expose-Headers headers (if any), before exposing response headers to APIs defined in CORS API specifications.
Simple response headers are limited to:
All other headers that the client needs to access in the response must be "exposed" via the response header I mentioned above.
Firebase Cloud Functions: PubSub, "res.on is not a function"
TypeError: Cannot read properties of undefined (reading 'createMessageComponentCollector')
im new to JS and having an issue toggle show / hide for a hidden ul menu.
Firstly a bit of background: I'm modifying Drupal's backend (Node creation form) to dynamically add an html to a dynamically created element. .
Thanks guys for looking into my question. I have this form that I use ajax to submit to the mysql database using laravel.