homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

Setting Cache headers different for CDN and browser

 5:44 am on Feb 14, 2012 (gmt 0)

Is it possible to set different headers for CDN and for my end user? I use origin pull for my CDN and it honors the caching headers that I set.

So, if i put, max-age header to two days, my CDN will cache the page for two days.

I use header("Cache-Control: maxage=172800, public") in my PHP code.

But I guess the browser of my site visitor will also cache the page for two days and will not send a new request on second or further requests to the page. Is it possible not to set headers for the browser, but for the CDN?



 1:55 pm on Feb 14, 2012 (gmt 0)

does the browser get a Cache-Control header from the CDN or an Expires header?


 4:08 am on Mar 30, 2012 (gmt 0)

The browser gets the Cache-Control header from the CDN.

In fact, the CDN forwards the cache headers set by my website.

Webserver => CDN => User

I want to set the header for CDN to cache content for 2 days, but the User should see the cache header set for 10 minutes. The reason is, I can manually purge the cache from the CDN whenever I update the content.


 12:38 pm on Mar 30, 2012 (gmt 0)

i would first check to see if there are custom/proprietary headers available for your CDN service that would get stripped before forwarding to browser requests.


 1:55 pm on Mar 30, 2012 (gmt 0)

My CDN forwards all the headers that were sent to it. Does something like public for visitors and must-revalidate for CDN work?


 2:29 pm on Mar 30, 2012 (gmt 0)

according to the Hypertext Transfer Protocol -- HTTP/1.1

Cache directives MUST be passed through by a proxy or gateway application, regardless of their significance to that application, since the directives might be applicable to all recipients along the request/response chain. It is not possible to specify a cache- directive for a specific cache.

this means you won't fix this without a CDN-specific cache control header.


 3:35 am on Apr 1, 2012 (gmt 0)

Seems, I have no solution to this problem. Thanks anyway.

Global Options:
 top home search open messages active posts  

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved