For that there are the RFC, are technical documents developed and maintained by the IETF (Internet Enginnering Task Force), an institution that specifies the standards that will be implemented and used throughout the Internet.
According to the RFC 2616, section 10:
10.3.5 304 Not Modified
If the client has performed a conditional GET request and access is allowed, but the Document has not been modified, the server SHOULD Respond with this status code. The 304 Response MUST NOT contain a message-body, and Thus is Always terminated by the first Empty line after the header Fields.
The Response MUST include the following header Fields:
Date, unless its omission is required by Section 14.18.1
If a clockless origin server Obeys These Rules, and proxies and clients add their Own Date to any Response Received without one (as already specified by [RFC 2068], Section 14.19), caches will Operate correctly.
Etag and/or Content-Location, if the header would have been sent
in a 200 Sponse to the same request
- Expires, Cache-Control, and/or Vary, if the field-value Might
differ from that sent in any Previous Response for the same
Variant
If the conditional GET used a Strong cache Validator (see Section 13.3.3), the Response SHOULD NOT include other Entity-headers. Otherwise (i.e., the conditional GET used a Weak Validator), the Response MUST NOT include other Entity-headers; this prevents inconsistencies between cached Entity-bodies and updated headers.
If a 304 Response indicates an Entity not Currently cached, then the cache MUST disregard the Response and repeat the request without the conditional.
If a cache uses a Received 304 Response to update a cache entry, the cache MUST update the entry to reflect any new field values Given in the Response.
In short
For your answer, you can use yes 304
since the user request will not modify anything on the server and you are just returning the image.
Sources:
the normal is code 200 unless you want to send a specific status. If you want to use an image to represent a page not found, you can use 404, for example.
– Daniel Omine
But in this case, I need a status that represents an existing image, but it should be returned by PHP.
– Wallace Maxters
Ué.. then it is 200 rsrss
– Daniel Omine