RWS / dxa-web-application-java

SDL Digital Experience Accelerator Java Spring MVC web application
25 stars 37 forks source link

Model properties mapped with _self cause unnecessary link resolver round trip #112

Open willprice76 opened 6 years ago

willprice76 commented 6 years ago

In the GenericSemanticModelDataConverter.selfLink method there is always a round trip to the link resolver to resolve the link: https://github.com/sdl/dxa-web-application-java/blob/58a4fdebafc192b9a87570c684bd97d9091fdc5f/dxa-framework/dxa-tridion-provider/src/main/java/com/sdl/dxa/tridion/mapping/converter/GenericSemanticModelDataConverter.java#L83 This can be unnecessary as:

  1. If you want to convert to an EntityModel, you don't use the link URL
  2. Using the DXA 2.0 model service there should already be a resolved link URL in the EntityModelData (check .getLinkUrl())

This will cause performance problems on pages containing many component presentations, which map to models with a _self SemanticProperty annotation.