Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Link/Anchor Tags Generate Slowly - Link Checker Already Disabled

jocamp
Level 4
Level 4

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

1 Accepted Solution
Paul_McMahon
Correct answer by
Level 8
Level 8

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. 

View solution in original post

3 Replies
Paul_McMahon
Level 8
Level 8

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. 

Paul_McMahon
Correct answer by
Level 8
Level 8

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. 

View solution in original post

jocamp
Level 4
Level 4

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