Link/Anchor Tags Generate Slowly - Link Checker Already Disabled | Community
Skip to main content
Level 3
October 16, 2015
Solved

Link/Anchor Tags Generate Slowly - Link Checker Already Disabled

  • October 16, 2015
  • 3 replies
  • 1683 views

I'm looking at speeding up a component that just prints a large amount of <a> tags for a menu. Originally it took 70ms to generate this component which didn't make sense to me since this was just calling out.write() on a cached string. I disabled link checker in the component using the setIgnoreExternals and setIgnoreInternals methods and this got me down to around 15ms. This is much better but still accounts for almost half of our page generation time (locally). On a hunch i changed all of the <a href".."> tags to <span href=".."> and this dropped the generation time to 5ms. Is there anything else happening within CQ that would cause <a> tags to render slower than another tag? I'm using the CQ timing component to get the generation times.

Thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by PaulMcMahon

Actually I ran across this - http://www.wemblog.com/2011/10/how-to-make-sure-that-links-are-always.html. It might give you the behavior you are looking for. 

3 replies

Level 8
October 16, 2015

The change between <a href = to <span href= is a demonstration of what's happening. The Link Checker Transformer is parsing the HTML as it flushed to out and looking for a sub-set of tags (I think a, link, image, script maybe - there might be some others). When if finds a matching tag it then evaluates the attribute containing the link - the first thing it does is check value to see if it is internal or external. With your configuration you have prevented it from actually checking the link, but its still parsing the HTML, pulling the value out of the attribute and checking to see if it's external or internal. 

What it sounds like you want to do is actually turn off the link checking entirely so that it doesn't even both parsing the HTML. I don't know if there is a way to do that on a component level - it's either on or off at a page level I believe. 

PaulMcMahonAccepted solution
Level 8
October 16, 2015

Actually I ran across this - http://www.wemblog.com/2011/10/how-to-make-sure-that-links-are-always.html. It might give you the behavior you are looking for. 

jocampAuthor
Level 3
October 16, 2015

That makes perfect sense, thank you! I'll take a look at that link and see if configuring any of those settings will help.