iriyazuddin OK, now we know what the actual problem is.
I have allowed the header, but please note at this point in time the actual API is not comparing the header value and the response to return a 304. You will only get an HTTP 304 if the response is cached in the API Gateway, if for some reason the Gateway decides the request is a cache miss or by pass, you will still get a 200.
I do want to understand why you are complicating your life by implementing this on a date based API? If the date changes, obviously the timings are different.
It would make sense for the Qur'an API, sure, so I will add this code to it.