304 Response code failure with java script Application

We have a problem with 304 response code

First Scenario:

→ VS listen on HTTPS and Server on HTTP with client SSL profile only with automap

→ Here we viewed that GET HTTP request sent with more header than the second scenario with “if modified since” header and “if none match” header

→ Which caused server respond with 304 response code

All 304 response code appeared with URL contain “JS” only

Second Scenario:

→ VS listen on HTTP and server on HTTP with automap

→ Here Server respond without any “if modified since” header and “if none match” header

→ As well as the server respond with 200 response code

All 304 response code appeared with URL contain “JS” only

Ok. What is the problem and how it should work?

its expected to get a 304 response with a HTTP request header containing If-None-Match or a If-Modified-Since header, And the reason it happens for java script files is because static content will be cached.

@Surgeop … the problem that backend server responds with 304 not 200 when applied VS HTTPS

I see. As Nesh mentioned below 304 is not error message. It just means that java script was cached on the client side and it was not updated on the server side since last download, thus it was not provided by the server side. This is as per HTTP rules and nothing wrong with it until it breaks service on you side.

You Mentioned "Which caused server respond with 304 response code "

Hence i assuming the web requests are not properly handled by the web server, i have seen this in the past with ajax calls[XMLHttpRequest].

Also, you can try the below irule on the VS

when HTTP_REQUEST { 
if { [HTTP::header exists If-Modified-Since] } { 
   CACHE::disable 
} 
}