Hot answers tagged

5

Azure Front Door and Azure CDN use the RFC-7233 implementation of Range header requests. (Source) In Sitecore, the Media.EnableRangeRetrievalRequest setting is enabled by default. It is implemented based on RFC-2616, but as far as I can tell RFC-7233 has superseded it and it looks like Sitecore has not updated the Range header handling to support the changes ...


4

Actually a product exists which supports to serve HTML from CDN (currently Netlify Edge) for Sitecore. It's called Uniform for Sitecore available here: https://uniform.dev/sitecore-netlify-stack. Here is the an image how it works, stolen from the website.


4

You could serve your content pages from any CDN which supports serving html. Question is, do you want to do this and why? Let's just think about 1 thing: Your client bought Sitecore, not wordpress. They most probably want to personalize, content test, use marketing tools. Will any of that be possible with pages being served from CDN? How can content be ...


4

I'm on a proof of concept for the same question at the moment this week. What i'm doing: 1. no caching for personalisation - Set Cache header for all pages ==> Hit from Cloudfront - Set No Cache header for pages with personalisation. ==> Miss from Cloudfront (Currently testing) Set a Cookie with the Value of a rule Whitelist that cookie in cloudfront in ...


4

Adding a query string will fix your issue. But it will break all your analytics reports(For example you won't be able to track number of downloads for any given pdf etc) I would utilise cloudflare API to purge the individual media item cache when upload a new one. https://api.cloudflare.com/#zone-purge-individual-files-by-url-and-cache-tags


3

I think that this is a bug in Sitecore. Here's whats happening When you enable the CDN config, it sets Media.AlwaysAppendRevision to true This appends rev=xxx to all media urls The media request protection protectedMediaQueryParameters config has <parameter name="rev" description="media revision"/>. The media request protection code in Sitecore....


3

To resolve the CORS CDN error , You would need to create a pipeline which adds the below request headers.This pipeline was written for Cloudfront on Amazon AWS instance , but the underlying logic is to add the Access-Control-Allow-Origin headers to Sitecore requests. public class CDNResponseHeaders : HttpRequestProcessor { public override void ...


3

Custom code is necessary to achieve this since you want to generate media urls in different ways based on the context site. Override the MediaProvider and provide config nodes to determine which sites use CDN urls. Add a sitecore config patch: <?xml version="1.0"?> <configuration xmlns:patch="http://www.sitecore.net/xmlconfig/"> <sitecore&...


2

It truly depends on how the CDN is setup. The way we have done it is that its transparent and has nothing to do with Sitecore. If an image/asset (js/css/docs) are requested by the end user, the first request goes to Sitecore and the subsequent requests go to the CDN. If you change an image due to personalization reasons, again the first request will go to ...


2

After speaking to Sitecore Support I received the following answer. I hope this can help someone else experiencing the same situation. Sitecore client/backend does not support running behind a CDN especially when caching and OWASP ruleset are enabled. Sitecore has registered a feature request for the product so that it can be considered for future ...


2

The simplest solution is to append an additional querystring parameter such as the updated date or revision id like in this previous answer I provided. You can do this by inheriting MediaProvider and override GetMediaUrl(): using Sitecore.Data.Items; using Sitecore.Diagnostics; using Sitecore.Resources.Media; namespace MyProject.CMS.Custom.Media { ...


2

You can add the following rewrite rule to your web.config to add the required header on font files. The benefit of this is that you don't need any extra code - IIS rewrite module is available by default on Azure WebApps. <system.webServer> <rewrite> <outboundRules> <rule name="Enable CORS for Fonts"> <...


2

I could not find anything about EXM and CDN urls. I guess it is expected in the scaled environment, the EXM dispatcher would be on its own server witn CDN turned on. For my CM environment, I added a new processor to the modifyImageLink pipeline that changes the server url to the CDN url via configs. namespace Client.Project.EmailCampaign.Pipelines....


1

Cristi answer pointed me to right direction, however at the end I extended GetPageRenderingProcessor. public class CustomBrowserCaching : GetPageRenderingProcessor { public override void Process(GetPageRenderingArgs args) { //Item currentItem; Assert.ArgumentNotNull((object)args, nameof(args)); Profiler....


1

In App_Config/Sitecore.config there is a processor defined for setting browsercaching <processor type="Sitecore.Pipelines.RenderLayout.BrowserCaching, Sitecore.Kernel" /> You can take a look at its implementation in sitecore.kernel.dll and you could add your own custom implementation by overriding it public override void Process(...


1

You can serve the pages entirely from CDN and use FXM to track the analytics. Definitely it needs AJAX implementation to dynamically load the personalized content. https://github.com/brimfulofashar/Sitecore-CDN


1

I stumbled across this while looking for a solution to the same issue and thanks to Mark's info I was able to get rid of the log spam by simply wrapping the GetMediaUrl in an extension method in which i'm foribly appending something that will be hashed with the media protection logic (so there will always be a hash value appended for places that I need it). ...


1

You can setup CDN normal way, but block access to the /sitecore on the CDN level. Then add subdomain like cms.example.com that points to the same server but without CDN. And you can setup ip restrictions for /sitecore


1

I got some help from one of my colleague about this issue So basically the suggestion made by the hosting provider about Request Header size is incorrect. There is a defined limit for Request Headers in CloudFront The limit is at 20,480 bytes (Maximum length of a request, including headers and query strings) > http://docs.aws.amazon.com/...


Only top voted, non community-wiki answers of a minimum length are eligible