Set Status code in image
Question

Hello to all,


I need to set a status code only for a image and not a page. How i can do this?


In development they always send a "200" in status code for a image, but i want to change for "304" only in a image.


Hey Thiago

Give us more details. Are you using REST ? Some HTTP Request?


Regards

Hi César, 


No, i use only a action inside HTTPRequestHandler named SetStatusCode. 

But Which is the context?
I did in the past something like this

Get HTTP status code of <img> tags

Hi Cesar,


I have some images in WB that in every page request they send a status code 200, but i want to change to 304.

Hi Thiago,

Are you using On-Premise infra or the Cloud PaaS? On PaaS, you have limited control over the infrastructure.

SetStatusCode mentions, Setting custom HTTP status codes is an advanced extensibility scenario, so be sure to test if it works as intended in your specific infrastructure.

However, if you are sending this image as a response to REST API call then it is fairly easy. Refer Change the HTTP Status Code of a REST API 

Regards,

Swatantra

Hello,


I have a On-Premise infra, and as i said to Cesar, i have some images in WB that in every page request they send a status code 200, but i want to change to 304. 

A image, i have 1 Web Block with has a image and in that image they send every time a status code


Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.