Welcome to WebmasterWorld Guest from 23.22.46.195

Forum Moderators: phranque

Setting Cache headers different for CDN and browser

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

5+ Year Member



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)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



does the browser get a Cache-Control header from the CDN or an Expires header?
4:08 am on Mar 30, 2012 (gmt 0)

5+ Year Member



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)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



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)

5+ Year Member



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)

WebmasterWorld Administrator phranque is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



according to the Hypertext Transfer Protocol -- HTTP/1.1

http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
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)

5+ Year Member



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

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month