The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WP Super Cache
Possible to cache custom HTTP header? (5 posts)

  1. szemian
    Posted 3 years ago #

    My site need a custom HTTP header to function correctly. The HTTP header is added through add_action('wp', 'add_custom_header');

    When the page is being cached using WP Super Cache, my custom HTTP header is missing. Since WP Super Cache is adding extra HTTP header as well (WP-Super-Cache: Served supercache file from PHP), is it possible to include this custom HTTP header as well? The value of the header is not fixed, meaning it changes from post to post.

    Your feedback would be highly appreciated.


  2. Hubert Nguyen
    Posted 3 years ago #

    Szemian, I was wondering the same thing when I played with Varnish and wanted to add specific Varnish TTL.

    Hopefully Donncha will check this thread. I'm very interested by using WPSC but being able to tweak the headers...

  3. Bill Dennen
    Posted 3 years ago #

    did you ever find a solution for this one?


  4. Hubert Nguyen
    Posted 3 years ago #

    I found out a hook for it, but I haven't done any tests yet. Maybe you can find a plug-in that can help, based on this additional info: http://en.hetarena.com/archives/1

  5. Hubert Nguyen
    Posted 3 years ago #

    I revisited this issue since I am now using custom headers as well. As far I as know, WP-SuperCache will remove all the custom HTTP headers, so my only option is to disable it and let Varnish to the caching. In theory there is no need for WPSC when there's a Varnish front-end, but I was overly cautious I assume. I had to disable WPSC to use my custom HTTP headers.

    Also, I'm not sure if WPSC could save the headers on file -- maybe it could in PHP mode, but probably not in htaccess mode.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Super Cache
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.