Cache-control: Private

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi all,

Is there any reason that Nop is setting the Cache-control header to "private"?

We are trying to get a reverse proxy working to cache content, but reverse proxies MISS all content with a cache control header set to private.

I tried adding the <httpProtocol> section to the web.config but, this sets the cache-control header to "private, public, expires=74464" which still prevents proxies from caching.

<httpProtocol allowKeepAlive="true">
            <customHeaders>
                <add name="Cache-Control" value="public, max-age=691200" />
            </customHeaders>
        </httpProtocol>

I have added the following the _Root.cshtml view which seems to give the right results, but I'm concerned that Nop is intentionally set to "private".

Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetExpires(DateTime.Now.AddHours(2));

Any thoughts pls?

Regards,
Al
11 years ago
higgsy wrote:
Is there any reason that Nop is setting the Cache-control header to "private"?
...
I'm concerned that Nop is intentionally set to "private".

As long as I remember there are no any certain instructions (web.config or any other places) in nopCommerce to set cache-control to "private".
11 years ago
Thanks Andrei - any issues you foresee with adding the cache-control header? By adding it into _Root.cshtml and _RootPopup.cshtml it doesnt impact on the Admin section at all which is a good thing.

Thanks
Al
11 years ago
No, I don't think it can cause any issues
10 years ago
hi higgsy
did you tested it ?
where exactly did you put the code?
in header tags?
7 years ago
I have the same problem in NOP 3.60 now in 2017.

Web Server Response is still the same: Cahe-Control: private, but in web.config I typed a string:      

<clientCache cacheControlMode="UseMaxAge" CacheControlMaxAge="1.00:00:00" />
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.