इसके माध्यम से साझा किया गया


शीर्षलेख और पादलेख आउटपुट कैश करना सक्षम करें.

Power Pages में शीर्ष लेख और फ़ुटर वेब टेम्प्लेट के लिए प्रसंस्करण प्रदर्शन में सुधार करने के लिए, हेडर और फ़ुटर आउटपुट कैशिंग सक्षम करें। पृष्ठ के हर बार लोड किए जाने पर शीर्षलेख और पादलेख वेब टेम्पलेट पार्स और रेंडर होते हैं. शीर्षलेख और पादलेख आउटपुट को कैश करना उल्लेखनीय रूप से पृष्ठ संसाधन समय को कम कर देता है.

हेडर और फ़ूटर टेम्प्लेट वेबसाइट रिकॉर्ड के विकल्प अनुभाग में हेडर टेम्प्लेट और फ़ुटर टेम्प्लेट फ़ील्ड द्वारा निर्धारित किए जाते हैं। यदि कोई शीर्षलेख या पादलेख टेम्पलेट निर्दिष्ट नहीं है, तो डिफ़ॉल्ट शीर्षलेख और पादलेख प्रदर्शित होते हैं।

आप कस्टम हेडर और फ़ूटर वेब टेम्प्लेट बना सकते हैं जो इस आलेख में उल्लिखित {% substitution %} टैग का उपयोग करते हैं।

सभी नई वेबसाइटों के लिए, आउटपुट कैशिंग डिफ़ॉल्ट रूप से सक्षम है। इस कार्यक्षमता का समर्थन करने के लिए निम्न साइट सेटिंग्स उपलब्ध हैं और डिफ़ॉल्ट रूप से सही पर सेट हैं:

  • शीर्षलेख/OutputCache/सक्षम: शीर्षलेख के लिए आउटपुट कैशिंग को सक्षम करने हेतु मान को सही पर सेट करें.
  • पादलेख/OutputCache/सक्षम: पादलेख के लिए आउटपुट कैशिंग को सक्षम करने हेतु मान को सही पर सेट करें.

यदि आपने Power Pages के नए संस्करण में अपग्रेड किया है, तो आउटपुट कैशिंग डिफ़ॉल्ट रूप से अक्षम है - यानी, हेडर और फ़ुटर वेब टेम्पलेट्स को प्रत्येक पेज लोड पर पार्स और रेंडर किया जाता है। आउटपुट कैशिंग सक्षम करने के लिए, आपको हेडर, फ़ूटर, और भाषाएँ ड्रॉपडाउन वेब टेम्प्लेट अपडेट करना होगा और आवश्यक साइट सेटिंग्स बनानी होंगी।

नोट

यदि आप केवल साइट सेटिंग्स बनाकर आउटपुट कैशिंग सक्षम करते हैं, तो शीर्षलेख और पादलेख के भाग ठीक से रेंडर नहीं होंगे और त्रुटि संदेश प्रदर्शित किए जाएँगे.

चरण 1: शीर्षलेख वेब टेम्पलेट अद्यतन करें

  1. पोर्टल प्रबंधन अनुप्रयोग खोलें.

  2. सामग्री>वेब टेम्पलेट पर जाएँ.

  3. शीर्षलेख वेब टेम्पलेट खोलें.

  4. स्रोत क्षेत्र में कोड अपडेट करें:

    • निम्न कोड खोजें और उसका अद्यतन करें:

      मौजूदा कोड

      <li>
          <a href={% if homeurl%}/{{ homeurl }}{% endif %}/Account/Login/LogOff?returnUrl={{ request.raw_url_encode | escape }} title={{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}>
          {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
          </a>
      </li>
      </ul>
      </li>
      {% else %}
      <li>
          <a href={% if homeurl%}/{{ homeurl }}{% endif %}/SignIn?returnUrl={{ request.raw_url_encode }}>
          {{ snippets["links/login"] | default:resx["Sign_In"] }}
          </a>
      </li>
      

      अद्यतन किया गया कोड

      <li>
         <a href={% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_out_url_substitution }} title={{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}>
         {{ snippets["links/logout"] | default:resx["Sign_Out"] | escape }}
         </a>
      </li>
      </ul>
      </li>
      {% else %}
      <li>
         <a href={% if homeurl%}/{{ homeurl }}{% endif %}{{ website.sign_in_url_substitution }}>
         {{ snippets["links/login"] | default:resx["Sign_In"] }}
         </a>
      </li>
      
    • निम्न कोड खोजें और उसका अद्यतन करें:

      मौजूदा कोड

        {% assign current_page = page.adx_partialurl %}
        {% assign sr_page = sitemarkers[Search].url | remove: '/' %}
        {% assign forum_page = sitemarkers[Forums].url | remove: '/' %}
        {% if current_page == sr_page or current_page == forum_page %}
          <section class=page_section section-landing-{{ current_page }} color-inverse>
            <div class=container>
              <div class=row >
                <div class=col-md-12 text-center>
                  {% if current_page == sr_page %}
                    <h1 class=section-landing-heading>{% editable snippets 'Search/Title' default: resx["Discover_Contoso"] %}</h1>
                    {% include 'Search' %}
                  {% endif %}
                </div>
              </div>
            </div>
          </section>
      {% endif %}
      

      अद्यतन किया गया कोड

      {% substitution %}
          {% assign current_page = page.id %}
          {% assign sr_page = sitemarkers[Search].id %}
          {% assign forum_page = sitemarkers[Forums].id %}
          {% if current_page == sr_page or current_page == forum_page %}
            {% assign section_class = section-landing-search %}
            {% if current_page == forum_page %}
              {% assign section_class = section-landing-forums %}
            {% endif %}
           <section class=page_section section-landing-{{ current_page }} {{ section_class | h }} color-inverse>
              <div class=container>
                <div class=row >
                  <div class=col-md-12 text-center>
                    {% if current_page == sr_page %}
                      <h1 class=section-landing-heading>{% editable snippets 'Search/Title' default: resx["Discover_Contoso"] %}</h1>
                      {% include 'Search' %}
                    {% endif %}
                  </div>
                </div>
              </div>
            </section>
          {% endif %}
      {% endsubstitution %}
      
  5. वेब टेम्पलेट सहेजें.

चरण 2: पादलेख वेब टेम्पलेट अद्यतन करें

  1. पोर्टल प्रबंधन अनुप्रयोग खोलें.

  2. सामग्री>वेब टेम्पलेट पर जाएँ.

  3. पादलेख वेब टेम्पलेट खोलें.

  4. स्रोत फ़ील्ड में, निम्न कोड खोजें और उसका अद्यतन करें:

    मौजूदा कोड

    <section id=gethelp class=page_section section-diagonal-right color-inverse {% if page %}{% unless page.parent %}home-section{% endunless %}{% endif %} hidden-print>
    

    अद्यतन किया गया कोड

    <section id=gethelp class=page_section section-diagonal-right color-inverse {% substitution %}{% if page %}{% unless page.parent %}home-section{% endunless %}{% endif %}{% endsubstitution %} hidden-print>
    
  5. वेब टेम्पलेट सहेजें.

चरण 3: भाषा ड्रॉपडाउन वेब टेम्पलेट अद्यतन करें

  1. पोर्टल प्रबंधन अनुप्रयोग खोलें.

  2. वेबसाइट>वेब टेम्पलेट पर जाएँ.

  3. भाषा ड्रॉपडाउन वेब टेम्पलेट खोलें.

  4. स्रोत क्षेत्र में, निम्न कोड को ढूंढें, और सुनिश्चित करें कि url की बजाय language वस्तु url.substitution विशेषता का इस्तेमाल करती है.

    <a href=/{{ language.url_substitution }} title={{ language.name }} data-code={{ language.code }}>{{ language.name }}</a>
    
  5. वेब टेम्पलेट सहेजें.

चरण 4: साइट सेटिंग्स बनाएँ

निम्नलिखित साइट सेटिंग्स बनाएँ:

नाम मान
शीर्षलेख/OutputCache/सक्षम सत्य
पादलेख/OutputCache/सक्षम सत्य