what is If-Modified-Since HTTP header?
you don’t need to worry about this unless you have thousand of webpages and updates daily.
There is option to add If-Modified-Since HTTP header to WordPress site.
you can do this by adding below code
header("Last-Modified: " . the_modified_date()); to wp-config.php at the end of it before ?>.
or before /* That’s all, stop editing! Happy blogging. */
This also not working as error says “Fatal error: Call to undefined function the_modified_date() ”
2nd method using plugins.
Adds the ETag, Last-Modified, Expires and Cache-Control headers to HTTP responses generated by WordPress to facilitate caching.
this plugin working to enable if modified since for WordPress
it works on posts only not for the homepage.
A simple plugin to sent “304 If Modified Since HTTP Header” to the web crawlers, so that they only fetch your site when something updated.
add below code at the end confing php before it closes before ?>
("Last-Modified: " . the_modified_date());
also follow this thread on stackoverflow.
Enabling If-Modified-Since HTTP header by .htaccess
# enable expirations
# expire GIF images after a month in the client’s cache
ExpiresByType image/gif A2592000
# HTML documents are good for a week from the
# time they were changed
ExpiresByType text/html M604800