• Hi, and thank you for a wonderful plug-in.

    Do you know any way to add the If-Modified-Since header in an efficient manner?
    I found this suggestion that looks promising, but I do not know if it has any bad side-effects:
    https://www.ryadel.com/en/wordpress-fix-home-page-cache-caching-issue-last-modified-header-most-recent-post/

    Could you consider to add something like that as an option under cache headers?

    Also, I currently add “Server” as a custom header through your plugin, which is fine, but it would be even more convenient if there was explicit support for those as well.

    (I add “Server” just to override the real server response with something a bit more misleading.)

    • This topic was modified 5 years, 6 months ago by oyda. Reason: Noticed that "Expect-CT" was already supported. No need to use custom header for that
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Dimitar Ivanov

    (@zinoui)

    Hi @oyda

    Thank you for your suggestions. I appreciate it.

    You should know that it’s a bit hard to manipulate the Server header. I’m pretty sure that setting a custom header won’t work.

    If you have an access to the httpd.conf, you can add this line:
    ServerTokens Prod

    This will reduce the amount of information about your server software. So, if this is the server header value now:

    Apache/2.4.35 (Win64) OpenSSL/1.1.0i PHP/7.2.11

    after setting the ServerTokens will become:

    Apache

    Note that this solution won’t work inside the htaccess file.

    About the If-Modified-Since header – I didn’t use it till now, so first I have to get to know more about it.

    @oyda,

    The If-Modified-Since header is a request header, not a response header. As such, it is sent from the browser with the request and should not appear in the response. It would make no sense for @zinoui to implement this in a server-side plugin. The browser would simply ignore it.

    This is essentially how it works in the client-server dialogue:

    Browser:
    I have a cached copy of this asset that has exceeded its expiry time. Send me the latest version, but only if it’s newer than my copy.
    If-Modified-Since: <timestamp of my cached object>

    Server:
    304 Not Modified (continue using your cached copy for now; I’ll save time and bandwidth by not sending you what you already have)
    or
    200 OK (the asset was changed since then, so here’s the new version)

    Reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Support for If-Modified-Since header?’ is closed to new replies.