QUESTION:
Why re-executing a prompted document using the “re-prompt” button (see below) takes less time than re-executing the same document via URL-API in Strategy Web 9.x?
ANSWER:
By design, when an URL-API link is used to run a document, a separate server message and a new document instance are created. This because the most common usage of the URL-API links to a different document. Therefore, even if the URL-API links to the same document, a separate server message and a new document instance will still be created from the document definition in the metadata (indeed, if previous manipulations performed before clicking the link are not saved, these manipulations will be lost and the user will still get the metadata version of the document).
On the other hand, using the re-prompt button won't create a brand new server message. Rather, the already-existing document instance will be used (indeed, non-saved manipulations will still be shown in the re-prompted document in this case).
Since creating a new server message and a new document instance might be time-consuming (loading objects from the metadata, etc.), using URL-API links to run documents should actually be slower than re-prompting them. This is by design and different mechanisms are involved in these two scenarios.
Note: The time spent after clicking on the URL-API link and the time spent after clicking on "Run Document" in the prompt page are not comparable at all, since the time spent between clicking on the re-prompt button and clicking on the "Run Document" button should be taken into consideration as well (in this time-frame, the server needs to load the prompt definition and the prompt current answer(s), and display them to the user).