BillH Posted May 1 Posted May 1 I have created a module that uses a modal dialog (an iframe containing a PW form) to insert anchors into a CKEditor field. It is heavily based on ProcessPageEditLink, though is substantially simpler. The purpose of the dialog is to make selecting a page with a certain template much easier and more efficient for users than with the standard ProcessPageEditLink dialog. This is necessary because the selection is from about 7,000 pages with a particular template - and the number will grow. (The pages are bibliographic entries that are frequently linked to in the text.) The only active field in the form is InputfieldPageAutocomplete (not used in ProcessPageEditLink), as this is the most efficient way (that I can think of) to find the page needed. So, clicking a button in CKEditor (CKE plugin) opens an iframe containing a PW form (PW module). An "Insert Reference" button inserts the anchor (using a simple endpoint to get the URL for the page, as InputfieldPageAutocomplete doesn't provide this). The problem is this: the first time the dialog loads for a particular page, there's a delay of about 6–8 seconds before the content of the modal appears – that is, the modal appears, but remains blank for several seconds. Subsequently, the delay is only a fraction of a second. If I go to a new page I suspect the InputfieldPageAutocomplete field is the cause of the issue, but I can't find any evidence to support this. As I understand it (and I could be wrong), InputfieldPageAutocomplete doesn't preload data – it does an AJAX search on pages. I've tried all the profiling I can think of (timers in the scripts, monitoring network traffic), but this hasn't revealed anything. Does anyone have suggestions for what the cause of the trouble might be – or even where I could look next? Or ideas for an alternative plan? Thanks!
bernhard Posted May 1 Posted May 1 I've read several times that slow page loads came from lots of pages being loaded into memory when loading the page. This might be due to a poorly configured page reference field (eg a selectbox with thousands of pages) or maybe another module with a totally different purpose. I think you are right that an autocomplete field should not cause any issues. I'd try to look into the debug tools first and see how many pages are loaded on that initial iframe request. You should see that in the bottom right corner if debug mode is on. 1
BillH Posted May 1 Author Posted May 1 Many thanks @bernhard, you put me on exactly the right track to fixing this. The cause of the trouble was in another module that was loading and processing data from many pages when the current page loaded for editing. Fortunately, I'm already planning to replace the problem module with something much more efficient. I knew it was struggling, but it didn't occur to me that it might interfere with the new module! Thanks again! 2
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now