I want to implement If-Modified-Since HTTP header in my drupal site. How do I ensure the If-Modified-Since HTTP header is supported and that it is active?. If it is supported but not active then how to make it active?
As you can see in
drupal_serve_page_from_cache function, Drupal knows and uses this headers. Exact quote is:
If the request is conditional (using If-Modified-Since and If-None-Match), and the conditions match those currently in the cache, a 304 Not Modified response is sent.
How can you test? Obviously you can forge HTTP request in your user agent and see. Or you can believe in built-in tests.
Of course if you will not turn any cache on, there is no reason to react to If-Modified-Since, because you have no cached data to serve if content is not modified. Default cache is located under http://example.com/admin/config/development/performance, and you can use other cache modules and mechanisms, too. Then, it's up to them to react to cache-related headers properly.