Skip to content

ernstk/EPiServer.CdnSupport

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EPiServer.CdnSupport

Rewrites media URLs in EPiServer CMS. URLs are made unique and cacheable for 1 year. No configuration required.

Example: Media URL /globalassets/alloy-track/alloytrack.png will be rewritten to "/4a768e/globalassets/alloy-track/alloytrack.png" where the injected key is short form of the saved/published date ensuring the URL changes when the media changes. Requests where the injected key is outdated will be permanently redirected to an updated key for SEO reasons and to make sure bookmarks continue to work.

Supports CMS 9+.

OPTIONAL:

Custom expiration

The default expiration of 1 year is designed to optimize the length media stays in browser caches and that does not mean the content have to stay in a CDN for a year, see CDN documentation on which rules apply. To set a custom expiration add the following configuration. In the example below the expiration is set to 7 days.

  <appSettings>
    <add key="episerver:CdnExpirationTime" value="7.0:0:0" />  
  </appSettings>

External URL

If URLs to media should be rewritten to point to an external CDN use this configuration, do not use in combination with site specific assets in a multi site setup since multiple CDN hosts would have been required.

  <appSettings>
    <add key="episerver:CdnExternalMediaUrl" value="http://static.site.com/"/>
  </appSettings>

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%