How to make apache always return 200 code with data instead of 304?

I would like to get an Apache HTTPD 200 return response code with resource request data via GET instead of returning a 304 response code without data. Does anyone have an idea how to do this?

Thank you in advance

+3
source share
4 answers

remove the header, add the following to the httpd.conf file

<FilesMatch "\.(filetype1|filetype2)$"> RequestHeader unset If-Modified-Since RequestHeader unset If-None-Match </FilesMatch> 
+7
source

Add the following directive to the apache configuration file

RequestHeader unset If-Modified-Since

This ignores the IF-Modified-Since header sent by the client, so you will not receive a 304 Not Modified response.

+2
source

When sending a request, do not send him cache headers ( If-Modified-Since , If-None-Match and friends). This tells the server that the client is not caching and always returns data.

0
source

I'm not sure I fully understand your question. I assume that you want to provide a normal HTTP response if the client uses the correct URL and the default page (with status 200) when the client uses a non-existent URL.

If so, this can be achieved as follows:

 RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^.*+ /dummy.html 

The first line is the condition that the URL does not process an existing file on the web server. If this condition is met, the second line is executed, which serves to the dummy page to the client.

-1
source

Source: https://habr.com/ru/post/948258/


All Articles