Страница, которая использует AMP Project и Razor Pages, загружается 8 раз - PullRequest
0 голосов
/ 11 июня 2018

На этой минимальной HTML-странице AMP (см. http://ampproject.com) с использованием Razor Pages, точка останова в OnGet многократно - обычно 8 раз - при каждой загрузке страницы. Почему это должно быть? Может кто-нибудьподскажите что не так? Заранее спасибо.

Вот c #.

using Microsoft.AspNetCore.Mvc.RazorPages;
namespace iVoterGuide.com.Pages {
    public class IndexModel : PageModel {
        public void OnGet() {
            // ***** The breakpoint is set here
        }
    }
}

Вот cshtml. Как видите, он содержит только минимальные скрипты и прочие вещитребуется AMP, плюс содержимое "ТЕСТОВОЕ ТЕЛО".

@page
@model iVoterGuide.com.Pages.IndexModel
@{
    Layout = null;
}

<!DOCTYPE html>
<html ⚡>
<head>
    <meta charset="utf-8">
    <link rel="canonical" href="IndexWholePage.cshtml">
    <meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1"/>
    <title>IndexWholePage</title>
    <!-- Structured Data
    –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <!-- JSON-LD -->
    <script type="application/ld+json">
        {
        "@@context": "http://schema.org",
        "@@type": "NewsArticle",
        "headline": "page title",
        "datePublished": "2018-05-19 14:52",
        "image": [
        "logo.jpg"
        ]
        }
    </script>
    <!-- Facebook -->
    <meta property="og:url" content="page url" />
    <meta property="og:title" content="page title" />
    <meta property="og:image" content="document image" />
    <meta property="og:description" content="document description" />
    <meta property="og:site_name" content="iVoterGuide" />
    <meta property="og:type" content="article" />
    <meta property="og:locale" content="en_US" />
    <meta property="og:fb:app_id" content="" />
    <!-- Twitter -->
    <meta name="twitter:site" content="@@iVoterGuide" />
    <meta name="twitter:creator" content=" " />
    <!-- Boilerplate Scripts/Styles
    –––––––––––––––––––––––––––––––––––––––––––––––––– -->
            <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style>
    <noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>

    <!-- Fonts & Icons
    –––––––––––––––––––––––––––––––––––––––––––––––––– -->
    <link href="https://fonts.googleapis.com/css?family=Roboto:200,300,400,500,700" rel="stylesheet">
    <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
    <script async src="https://cdn.ampproject.org/v0.js"></script>
</head>
<body>
    <h1>TEST BODY</h1>
</body>
</html>

Если я удаляю ⚡ из, то все работает нормально.

РЕДАКТИРОВАТЬ: Упрощенный и обновленный вопрос.

...