-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathSitecoreCDN.config
More file actions
86 lines (71 loc) · 4.22 KB
/
Copy pathSitecoreCDN.config
File metadata and controls
86 lines (71 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<!--This will replace sitecore media provider with custom one to generate right CDN url's for media-->
<mediaLibrary>
<mediaProvider>
<patch:attribute name="type">NTTData.SitecoreCDN.Providers.CDNMediaProvider, NTTData.SitecoreCDN</patch:attribute>
</mediaProvider>
</mediaLibrary>
<settings>
<!-- SitecoreCDN FILE VERSION CACHE SIZE
When using filename versioning, the results of the version lookup will be cached here for performance.
-->
<setting name="SitecoreCDN.FileVersionCacheSize" value ="5MB"/>
<!-- SitecoreCDN URL VERSION CACHE TIME
When affixing version information for unique urls, the versions lookups are cached for this amount of time before updating
-->
<setting name="SitecoreCDN.UrlVersionCacheTime" value="00:00:00" />
</settings>
<customHandlers>
<handler trigger="~/minify" handler="aws_minify.ashx" type="NTTData.SitecoreCDN.Handlers.MinifyHandler,NTTData.SitecoreCDN"/>
</customHandlers>
<pipelines>
<httpRequestProcessed>
<!-- this processor replaces the Response.Filter to replace media urls in the output -->
<processor type="NTTData.SitecoreCDN.Pipelines.CDNAttachFilter,NTTData.SitecoreCDN" patch:before="processor[@type='Sitecore.Pipelines.HttpRequest.ExecuteRequest, Sitecore.Kernel']" />
</httpRequestProcessed>
</pipelines>
<!-- CDN
enabled: if true, html will be processed so that media urls will be replaced by cdn urls, if false media urls are unaffected. Default value: false
filenameVersioningEnabled: If true, versioning hashes are appended to media urls to prevent overcaching by CDN.
If false version hashes are not added and Cloud Front may not pick up your file changes until expiration. Default value: false;
minifyEnabled: If true, .css and .js requests (requests containing !cf! in the url) coming from the CDN will be minified. Default value :false;
fastLoadJsEnabled: If true, processed html will have <script > tags automatically moved to right before the </body> to fast parallel load scripts. Default value: false
processCss: If true, (and minifyEnabled is true) .css requests from the CDN will have any "url([url])" values pointing to local static files or media library items replaced by version specific urls.
debugParser: If true, parsing errors from HtmlAgilityPack will be logged. Default value: false;
matchProtocol: If true, the cdnHostname will usa a protocol (http/https) matching the request, otherwise default to http. Default value: false;
-->
<cdn enabled="true" filenameVersioningEnabled="false" minifyEnabled="false" fastLoadJsEnabled="false" processCss="false" debugParser="false" matchProtocol="true">
<provider type="NTTData.SitecoreCDN.Providers.CDNProvider,NTTData.SitecoreCDN" />
<!-- Incoming requests matching these urls will be processed
.aspx is processed when Sitecore.Context.Item is resolved
-->
<processRequests>
<regex pattern = "\.asmx" />
<!-- matches any .asmx -->
</processRequests>
<!-- Incoming requests matching these urls will not be processed -->
<excludeRequests>
<!--<regex pattern = "Default\.aspx" />-->
</excludeRequests>
<!-- These regex patterns will prevent matching urls from being replaced in the outgoing html, doesn't affect Incoming request processing -->
<excludeUrls>
<regex pattern = "\.axd" />
<!-- this keeps ScriptResource.axd and WebResource.axd from being CDN'd-->
<regex pattern = "VisitorIdentification.aspx" />
<!-- this keeps the Sitecore Analytics request from being CDN'd -->
</excludeUrls>
</cdn>
<!--
cdnHostName: ex "cd1.mydomain.com" this url will be used in forming the new cdn urls of media
each site that wants to leverage CDN hosting, needs this attribute set (by .config or by MultiSitesManager)
<site .... cdnHostName = "cd1.mydomain.com" />
-->
<sites>
<site name="website">
<patch:attribute name="cdnHostName">cdnHostName</patch:attribute>
</site>
</sites>
</sitecore>
</configuration>