wrav / related

A simple plugin that adds a widget within the Craft CP page sidebar, allowing you to quickly and easily access related entries.
MIT License
5 stars 4 forks source link

Potential Speed Improvement #13

Open markhuot opened 3 years ago

markhuot commented 3 years ago

It seems that this plugin loads the relationships in and then, after the relationships are returned, updates the UI to display the "View" link. I'm working on a site that has several million relationships and it's causing the initial "View" link to take upwards of 60 seconds to load. Would it be possible to have the View link load in to the page immediately with an indicator that work is happening. Right now our editors aren't sure if it's working (in the background) or if something is broken while they wait for the link to appear.

reganlawton commented 3 years ago

@markhuot "several million relationships" Well shit I of course know that is possible but I NEVER expected to have to use it in that way, having such a large database.

There a lot of different ways to go about this and too be honest benchmarking performance is gonna be abit of a pain cos I'll have to build of a large database to test this so it'll take time. But I'll see what I can do.

reganlawton commented 3 years ago

Reading your message about more @markhuot is you thinking we add the VIEW button right away?

markhuot commented 3 years ago

Yes, add the View button right away and if the ajax request takes a minute to come back just pop up a spinner or an alert that the data has not loaded yet (until the Ajax request) comes in. The benefit being—the author doesn’t have to wait a minute to find out if the Ajax request timed out or failed before they know where to click.

Right now, we’re writing documentation along the lines of “load an Edit Entry screen and wait up to a minute—the “View” link should load at the bottom of the right meta data.” But it would be really nice if we could write “the data for the View button may take a minute to load” without telling them the UI will magically appear after a period of time.

fwiw, we’re loving the plugin—either way, just noting an issue we’re facing.