Is there a best practices article showing how to configure output-cache in order to have the dynamic pages of umbraco from a NGINX, Varnish or a CDN site?
Hmm, need some more info to answer that, what parts? - the umbraco backoffice or more in regard to the assets served as part of the front-facing website?
I refer to the front-facing website. Usually the CDN, Varnish or NGINX cache follows the output-cache HTTP header deciding if to store or not to store a cached copy of the page. I found no way to change that for the dynamic generated pages.
Did u ever find a solution for this? I've also noticed the Cache-Control header for all HTML pages for the front-end web site are set to private. I've had to override the header in my CDN, but it would be smarter to be able to set it. I can't see anywhere you can set the Cache-Control header in Umbraco for the front-end website. Anyone??
Still sounds like a hack for what should work out of the box :) I'm using CloudFlare and with their PageRules (same thing as yr Varnish config) you can over ride the headers so have a short term solution, but it's still not right.
After some time I realized it's not so bad. I have two DNS pointing to the same Umbraco CMS, one of which is cached and exposed to the CDN and the other which is not cached helping me to check the latest version of the content. It's like separating the responsibilities between the server delivering content and the server caching the content.
cache-control header for dynamic content
Is there a best practices article showing how to configure output-cache in order to have the dynamic pages of umbraco from a NGINX, Varnish or a CDN site?
thanks
Hmm, need some more info to answer that, what parts? - the umbraco backoffice or more in regard to the assets served as part of the front-facing website?
I refer to the front-facing website. Usually the CDN, Varnish or NGINX cache follows the output-cache HTTP header deciding if to store or not to store a cached copy of the page. I found no way to change that for the dynamic generated pages.
I wonder if in the urlrewrite module would it be possible to change the cache-control headers, based on some properties of the current document type?
Did u ever find a solution for this? I've also noticed the Cache-Control header for all HTML pages for the front-end web site are set to private. I've had to override the header in my CDN, but it would be smarter to be able to set it. I can't see anywhere you can set the Cache-Control header in Umbraco for the front-end website. Anyone??
Hi Karl,
I used varnish as an intermediary layer to removed all headers coming from umbraco.
On top of that i use NGINX to set headers to proper values.
here is the varnish script:
sub vcl_backend_response {
unset beresp.http.cache-control;
set beresp.http.cache-control = "public, max-age=86400";
if (beresp.ttl < 120s) {
unset beresp.http.cache-control;
unset beresp.http.expires;
set beresp.http.cache-control = "public, max-age=86400";
set beresp.ttl = 1w;
set beresp.http.magicmarker = "1";
}
}
Regards,
Bogdan
Still sounds like a hack for what should work out of the box :) I'm using CloudFlare and with their PageRules (same thing as yr Varnish config) you can over ride the headers so have a short term solution, but it's still not right.
After some time I realized it's not so bad. I have two DNS pointing to the same Umbraco CMS, one of which is cached and exposed to the CDN and the other which is not cached helping me to check the latest version of the content. It's like separating the responsibilities between the server delivering content and the server caching the content.
Regards,
Bogdan
is working on a reply...