Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8246155

The javadoc generated website loads some data twice

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 14.0.1
    • Fix Version/s: None
    • Component/s: tools
    • Labels:

      Description

      A DESCRIPTION OF THE PROBLEM :
      The javadoc generated website loads its search index twice. Wasting data transfer for both the server and the client. For example, each visit of https://docs.oracle.com/en/java/javase/14/docs/api/index.html wastes ~4.6MB of data, or ~600KB of compressed data.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. open a modern browser
      2. open developer tools > network
      3. enable "Disable Cache"
      3. load https://docs.oracle.com/en/java/javase/14/docs/api/index.html


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      For module-search-index, package-search-index, type-search-index, member-search-index and tag-search-index, either the zip file OR the Javascript file is loaded.
      ACTUAL -
      Both the 5 zip files (*-search-index.zip) AND the 5 Javascript files (*-search-index.js) are loaded. This wastes ~4.6MB of data, or ~600KB compressed.

      CUSTOMER SUBMITTED WORKAROUND :
      The following is not a workaround, but a direction for fixing the bug:
      In https://docs.oracle.com/en/java/javase/14/docs/api/script.js , the author tried to load 5 zip files, and fall back to javascript files if the zip files fail. The problem is that the loading of the zip files are asynchronous (see $.get(), JSZip.loadAsync(), zip.file().async() ). Therefore, the *searchIndex will not be loaded right away. In light of that, we should not check these variables and load fallback right away. Instead, do the checking and fallback-loading in each callback, for example in $.get().fail() and JSZip.loadAsync().then(handleZip(zip), handleError(error)) and etc.

      FREQUENCY : always


        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                pnarayanaswa Praveen Narayanaswamy
                Reporter:
                webbuggrp Webbug Group
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: