ASP.Net MVC Generates DNS Prefetch Tags

Is there a way to find all the URLs src=""when rendering an ASP.net MVC page in a view, then generate DNS prefetch tags on the fly?

https://www.chromium.org/developers/design-documents/dns-prefetching

+4
source share
1 answer

If I understood correctly, I can tell you the following:

Option # 1: (Not a good solution, but it will work.)

NOTE. To do this, try using simple Javascript and not rely on JQuery or something else (from this you still need to “load” the .JS file for this, and this breaks the point of your question.

src/href - - "OwnLogic", " ", , . :

<img url="" class="DNS_BaseTarget" DNS_BaseTarget="smiley.gif||myCDNPointerInfo" alt="">

javascript , DNS_BaseTarget, "src". javascript "<link rel="dns-prefetch" href="https://cdn.yourTargetDomain.com">", , .

, "" (, , ).

№ 2:

( MVC) , "Render()" , . : HTML/JS ? , HTML/JS ?

"" html , - "" ... "src/href", "<link rel="dns-prefetch" href="https://cdn.yourTargetDomain.com">", .

+4

Source: https://habr.com/ru/post/1675720/


All Articles