Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-92704

Sitemap.xml doesn't create new sitemaps passing 50k URLs or 50MB uncompressed for each layout

    Details

      Description

      Regarding search engine limitations, there are these rules for sitemaps:

      Any Sitemap file is limited to 50MB (uncompressed) with a maximum of 50,000 URLs.

      But if you pass this number, no new sitemap file gets created.

      With having 50002 web contents with certain display page

      Steps to reproduce:
      1) Run the following Groovy script:

      def company = com.liferay.portal.kernel.util.PortalUtil.getCompany(actionRequest);
      long companyId = company.getCompanyId();
      
      def user = com.liferay.portal.kernel.util.PortalUtil.getUser(actionRequest);
      long userId = user.getUserId();
      
      def guestGroup = com.liferay.portal.kernel.service.GroupLocalServiceUtil.getGroup(companyId, com.liferay.portal.kernel.model.GroupConstants.GUEST);
      def groupId = guestGroup.getGroupId();
      
      def type = com.liferay.portal.kernel.model.LayoutConstants.TYPE_PORTLET;
      
      def serviceContext = new com.liferay.portal.kernel.service.ServiceContext();
      
      def pagePrefix = "my-layout-";
      
      for (int i = 1; i <= 50001; i++) {
          def name = pagePrefix + i;
          def title = name;
          def description = name;
          def friendlyURL = "/" + name;
          com.liferay.portal.kernel.service.LayoutLocalServiceUtil.addLayout(userId, groupId, false, com.liferay.portal.kernel.model.LayoutConstants.DEFAULT_PARENT_LAYOUT_ID, name, title, description, type, false, false, friendlyURL, serviceContext);
      }
      

      2) When finished, download the sitemap.xml file from http://localhost:8080/sitemap.xml
      3) Executed the shell command:

      grep -o '<loc>' sitemap.xml | wc -l
      

      4) Check the value obtained by the command executed previously

      Expected behavior:

      • The value is 50000

      Actual behavior:

      • The value is 50002 (50001 pages created by the script plus the initial page already created at the time of the first installation)

        Attachments

          Activity

            People

            Assignee:
            lu.liu Lu Liu
            Reporter:
            Dragon96 Adel Alagha
            Participants of an Issue:
            Recent user:
            Yunlin "Steven" Sun
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              28 weeks, 6 days ago

                Packages

                Version Package
                7.1.10 DXP FP19
                7.1.10.5 SP5
                7.1.X
                7.2.10 DXP FP7
                7.2.X
                7.3.3 CE GA4
                7.3.4 CE GA5
                7.3.10 DXP GA1
                Master