Cache-Control header in Response

Hello Team,

The concrete website I am working with uses Cloudflare for DNS management and caching as well. I recently read about Origin Cache Control on Cloudflare including how it behaves when certain directives are used in Cache-Control headers. Now, I need to get rid of one of those headers (see screenshot) but I am finding it difficult to locate the core file in concrete to edit.

In the screenshot, I want to remove the first Cache-Control header that contains the “no-cache” directive.

image

The first file I checked was the .htaccess file but I only found the second Cache-Control header in there (which is something I want to keep). I am relatively new to concrete and its core files and source code, so any advice or suggestion pointing me to the right direction will be appreciated.

Thanks!

@danielexrx Concrete CMS itsself send Cacne-Control header.

It looks like that 1st no-cache, private output comes from Concrete.

You must enable full page cache on the target page.

You also need to make sure that you don’t have any block that stopped enabling full page cache… OR you can force set full page cache.

Then, Cloudflare will cache your Concrete CMS page.

You also need to make sure that you have properly set cache rule at Cloudflare side. I usually set like… if the host name is “example.com”, respect origin cache-control.

ALSO, it’s important to add the cache rule that if there is CONCRETE_LOGIN=1 cookie next, you bypass Cloudflare cache. Otherwise, you won’t be able to edit the page.

Now our Concrete CMS site is serving 70-80% traffic via Cloudflare cache.

1 Like

Thank you for your comment. I will look into my concrete site with what you’ve suggested!

Hi @katz515,

Thank you for your suggestion, but that didn’t remove the Cache-Control header file. I don’t know why enabling full page cache on Concrete didn’t work, but I had implemented the rest of your suggestions earlier. Myself and a team member just wants to observe the behaviour of the site if that header is removed.

I am wondering if maybe the full page cache on Concrete didn’t work because we are currently using Concrete version 8.5.7. It was explained to me that we won’t be able to upgrade as we have a lot of custom addons developed on our site and we are not sure if it will work with the newer version.

I am hoping maybe this header file can be removed from a core concrete file, if that exists.

Thank you for your time! :smile:

@danielexrx

we are currently using Concrete version 8.5.7.

Ah, I know that latest version of Concrete CMS V9 output cache-control header properly…

I don’t remember well… but yeah…, I remember that it didn’t output cache-control header properly.