2

Right now when I publish the Publish HTML Design page, it will push all design resource to one of the site folder. Is there anyway I can modify it to publish all resource to CDN?

2
  • 1
    Can you share more about the CDN you are using? Most CDN providers will pull from your site directly, so you may just need to invalidate/purge your CDN rather than publishing directly to it. Sep 19 '16 at 23:11
  • It is true CDN can pull the resource from the site, but the URL which be generated by Tridion is not CDN link. How can I inject the logic, to replace all resource link to its correspond CDN link? For example: the link generated by Tridion in the page looks like: http://examplesite.com/resourcefolder/52/xxx.js. The CDN like will looks like: https://akamai.com/examplesite/resourcefolder/52/xxx.js
    – qchen01
    Sep 20 '16 at 1:17
3

If you want to rewrite (some of) the links generated by DXA, you can implement your own Link Resolver.

You find the default Link Resolver implementation (.NET) here: https://github.com/sdl/dxa-web-application-dotnet/blob/master/Sdl.Web.Tridion/Linking/DefaultLinkResolver.cs

Your custom Link Resolver could call the Default Link Resolver and the post-process the resolved site URL.

You can register your custom Link Resolver in Unity.config

1

Based on comment, it seems that you are looking for strategy to clear the resource from Akamai. Given below are the details based on that assumption.

CDN caching can be cleared using the querystring parameters. On Akamai you can set it query for the resource again.

To achieve this, you can create a TBB that will add timestamp to the url after which your url will be: http://examplesite.com/resourcefolder/52/xxx.js?v=201609192311. Now if you publish a new version of the same resource again, the url will be http://examplesite.com/resourcefolder/52/xxx.js?v=201609192316 and since Akamai set to query for resource as url has changed, you will get the latest resource.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.