We have created a custom XML feed, using a Wordpress page template, to load in custom posts. Here is our page: https://www.kortingvandedag.be/feed-copernica/

We use this for our email marketing. But now there is an issue, with this file being loaded in too often. Appearantly, the Expire Header is the following for this file:

Expires => Thu, 19 Nov 1981 08:52:00 GMT

Which is far in the past. According to support at our ESP, this should be 1 or 2 hours in the future.

I've used this website to check the Expire header: http://www.webconfs.com/http-header-check.php

We are running WP Rocket on our website and I've tried adjusting the ExpireByType codes, but it didn't work.

Any suggestions on how can I change the expire header for this specific page/file/XML feed?

  • 1
    Since it sounds like WP Rocket is setting this, it would be best to ask them. Without plugins and just core WP, you would need to look into adjusting your .htaccess file. – WebElaine Mar 29 '18 at 13:34
  • your assumption that by setting expiry differently you will have less hits on the page is probably wrong. You should redesign the code of the page if it is too slow, and if needed, explicitly cache it. – Mark Kaplun Mar 29 '18 at 15:12
  • Thanks @WebElaine. I've contacted their support and they explained me how to adjust expire headers. But according to them, you can only do this per type, not for a specific page. MarkKaplun, the reasoning of our ESP is: the feeds gets loaded too often and thus we should adjust expire header in order for it to be loaded in less often (only one or two times). We had this page non-cached by WP Rocket before, we're going to try if it works if just cache it. – Loyens Mar 30 '18 at 11:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.