Does/should server code run when the server return status code 304? I understand that the server should not return anything (client should use the cache), but I cant find any info on whether the server will executed the code in an api endpoint for example.
Is server code executed when server returns http status code 304
140 Views Asked by tobbe At
1
There are 1 best solutions below
Related Questions in HTTP
- Handling both JSON and form values in POST request body with unknown values in Golang
- Why can't I use PUT requests?
- nginx set up reverse proxy from subfolder to a port
- Async Web Server RP2040 returning ERR_CONNECTION_REFUSED?
- Getting `FormatException: Missing extension byte (at offset 6)` exception for accessing `response.body` from a server deployed in Vercel
- Retrieving list of values from MYSQL data base based on input value(LARAVEL 10 )(GET HTTP METHOD)
- Unable to add request headers via CHttpFile - C++/MFC
- Why do we call all http services 'Web Api/Web Service'?
- How to correctly read POST REQUEST body on ESP32?
- on linux gitclone issue remote server error showing fatal error with proxy n port
- Elasticsearch - cascading http inputs from Airflow API
- How to clean the html pages opened in a session?
- UTF-8 is not a valid encoding name
- I dont get the Result i expected when i want to get my Telegram Chatbot id
- NextJS 14 SSE with TransformStream() sending messages in a single response
Related Questions in HTTP-STATUS-CODE-304
- Google adsense ads.txt status cannot be not found
- Fetch API Returning 304 Not Modified in Angular
- revalidatePath() not working when it is deployed on Vercel
- Cache-control set to 8 hours from Java end is getting overridden by no-cache from server
- Spring WebClient: How to handle NOT_MODIFIED (304) responses with caching or else?
- jQuery Ajax Post 304 file nit modified
- Getting 304 status code on server console even after cache is deleted
- WebResourceResponse 304
- How to 'solve' 304 statusCode in nodeJS?
- Form on submit fails when i try to submit it with js
- how to reesolve react table setstate problem
- 304 ERR_BLOCKED_BY_RESPONSE for web worker file after enabling same-origin CORS to allow SharedArrayBuffer
- Is server code executed when server returns http status code 304
- Next-App deployed on Vercel: Request for new refresh-token leads to unwanted 304 Not Modified-response
- How to Get CORS to use HTTP 304 instead of HTTP 200 responses
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
RFC 2616 section 10.3.5 describes the 304 Not Modified response:
The server will send Date, ETag and/or Content-Location (200 only), or Expires, Cache-Control, and/or Vary if the respond may vary.
What is a Conditional GET?
An cliet application, browser, or proxy with a retained Last-Modified or Etag value will issue a Conditional GET as an initial header only. This allows the client to determine if the resource has been updated.
How does the client know if the resource changed?
Well it depends on how the server is configured.
The Origin Server May:
Almost Never. Disregarding that it is technically possible for an incorrectly configured application to respond with a 304 Not Modified code instead of a 200 code.
With a ETag and/or Content-Location value, a server (nginx for example) can confirm nothing has changed without issued a call to the application. This also neatly handles resources with version numbers the same way.
For query strings (
image.jpg?version=12), the client cache will invalidate the content. A Proxy Server will also invalidate, and the query will be requested fresh.I'm a fan of nginx, here is a good resource on how caching applies to it.
In short, as much as you can do to support various caches between your client and the application the more requests you can support per day.