I think I just discovered a bug. I'll file this as a bug at Adobes dedicated Feature / Bug report page:
1. Create new document
2. Import XML (as merge under root element - "create link" is NOT to be checked.)
3. Place an image on page 1.
4. Remove the XML file from the structure by pressing Delete on the top-most imported node.
5. Send the imported XML file to the trash can.
6. Select the image on page 1.
7. In the links palette, press "Relink" while holding down Alt, to relink all missing links.
8. Now InDesign asks for the XML file... the one that I previously imported as a non linked file.
I would expect no relinking of an XML file that was never linked.
This links collection is still "1", and that's the real image. No sign of the xml file there.
I have no idea if this relates to the slow kind of documents that I experience. This simple test on a bland document did not result in slowness. I can still switch quickly from other applications to InDesign.
[Bug report filed 20110120 15:50]
I've uploaded a video to demonstrate that InDesign sometimes can keep references to links:
It's obvious that there are thousands of "orphans" in the documents. All XML files ever imported are kept in some way... The links (or the names of them) are obviously not removed from the document when deleting the Element in the XML Structure. Since the communication of the code with a database is built around XML import, the number of imported files is very large.
Can these orphaned link references somehow be removed? When manually checking for missing files, InDesign loops though all of the XML files as seen in the YouTube video above, but ends up saying that there are no missing files. The next time I do the same check, all links are looped through again.
Perhaps we should "link to file", using .xmlImportPreferences.createLinkToXML = true
This propery has not been explicitly set, and therfore = false. But is there any way to get rid of all the old link names that's inside the document somehow?
CS4 does the same thing, but there is "no 2 second lag time" switching from another application to InDesign CS4 with this kind of document open.
I have still no idea how to get rid of the tons of old links in the existing documents, other than to recreate the documents from scratch.
At least with the createLinkToXML set to true, we seem to get no new XML link orphans.
This internal storing of xml data had caused the documents to grow, from about 1-2 MB to 5-10 MB, and the multitude of orphaned (invisible) links caused indesign CS5 to respond slower. Since there is a setting to let InDesign store imported data inside the document, shouldn't there be a way to reference and delete these links as well, since they are not deleted when the XML-structure is cleared? I think it should.
Any difference by just doing a "save as" on one of these documents? We still have not received CS5 over here (damn cheapskate executives) but for CS3 and any previous version I've worked with InDesign keeps a whole bunch of unnecessary data like previews for links which are no longer in the document, doing a "save as" can sometimes reduce the file size by several orders of magnitude. (Don't use "save a copy" though as that seems to make an exact copy of the document's current state, including any and all unused resources.)
I tried it now (also unchecking the "Always save preview images with documents" checkbox). No difference. Closing the "saved as" document and opening it up again, the "orphans" are still there, when running the "Search for missing links" utility.
Thanks for your the suggestions. (I don't envy your CS3, CS4 was such a big improvement when it came to performance, and just the wrong version to jump over as I see it, but some of our customers did the same thing.)