واکشی اولیه در HTML5 Prefetching - HTML5
نویسنده: مشتبآ
تاریخ: ۱۳۹۲/۰۳/۰۹ ۱۹:۵
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
<link rel="prefetch" href="http://www.example.com/page2.aspx"> <!-- Firefox --> <link rel="prerender" href="http://www.example.com/page2.aspx"> <!-- Chrome --> یا <link rel="prefetch" href="http://www.example.com/picture.jpg"> <!-- Firefox --> <link rel="prerender" href="http://www.example.com/picture.jpg"> <!-- Chrome -->
[ApiController]
[AllowAnonymous]
[Route(template: "/.well-known")]
public class PrefetchProxyController : ControllerBase
{
[HttpGet(template: "traffic-advice")]
[Produces(contentType: "application/trafficadvice+json")]
public IActionResult TrafficAdvice()
=> Ok(new[]
{
new PrefetchProxyTrafficAdvice()
});
}
public class PrefetchProxyTrafficAdvice
{
[JsonPropertyName(name: "user_agent")]
public string UserAgent { set; get; } = "prefetch-proxy";
public bool Disallow { set; get; } = true;
}[
{"user_agent": "prefetch-proxy", "disallow": true}
]