impress-org / google-maps-builder

One Google Maps plugin to rule them all. Google Maps Builder is intuitive, sleek, powerful and easy to use. Forget the rest, use the best.
https://wordpress.org/plugins/google-maps-builder/
32 stars 9 forks source link

Infobubbles are laggy when they open. Could we improve with caching? #230

Closed sstruemph closed 6 years ago

sstruemph commented 7 years ago

Just a general question and something to work on improving.

mathetos commented 7 years ago

Yes, thanks for creating the ticket. Here's a few things I'm thinking on this:

  1. Can we simply cache the infobubble content on pageload so that they open immediately?
  2. If not #1, then can we add the content to a cache after they are opened so that they open the second time more quickly?
  3. Preloading the content of ALL markers could slow down the entire page itself. Perhaps there's a way we can pre-load the content to a json file or something more accessible than having to hit the database.

All things to consider, but I do see customers commenting on the new slowness of the infobubbles so it is definitely something we need to address.

nishitlangaliya commented 6 years ago

@mathetos

I have gone through the suggestions for popup marker data more quickly. below are my inputs.

Here I have seen that data are fetch from lat long. and requesting to the google maps api. I implemented preloading the static data to marker on each marker and then click on the marker but it do not affects in speed of loading data into popup.

So loading popup data dynamically or static content or from json content will not affect speed of loading data. For more understanding I have prepare video for that please review it when you get a chance and let me know your inputs for the same.

https://www.useloom.com/share/0682bfc6a9154063acc6e20799a480e8

Thanks.

nishitlangaliya commented 6 years ago

@DevinWalker , @mathetos ,

As per suggestions, I have prepared new video with proper sound so please review it and let me know if any query.

https://www.useloom.com/share/9a6b4650e9c94c08869598c6f83ac420

Thanks

DevinWalker commented 6 years ago

Thanks @nishitlangaliya that video is much more clear. I believe this issue has to do with the mashup marker performance when they open and load via AJAX. The delay is similar at around 300ms which isn't terrible but for slower servers it could be a higher wait time.

Video

Review this for further description of the issue: https://goo.gl/3gcX8T

Possible Solutions

  1. Display a loading icon immediately upon clicking the marker to indicate the marker info is loading
  2. Load mashup data via JSON bypassing AJAX completely

Considerations

  1. For maps with thousands of markers would loading that much JSON do?
  2. For maps with many markers like above could we load the first few hundred then AJAX load the rest?
nishitlangaliya commented 6 years ago

@DevinWalker ,

Thanks for your suggestions.

As per your suggestions I have implemented below solution and done PR : https://github.com/WordImpress/Maps-Builder-Pro/pull/111

  1. Load mashup data via JSON bypassing AJAX completely.

Currently, on each click mashup marker, it makes an ajax call to load data. So instead of making ajax call every time when clicking on the marker. I have rendered json data while marker loading. So now it will completely bypass ajax and load data from json and on next time will load from transient until data is updated from the admin side.

Video:

https://www.useloom.com/share/5d78949ce43c45c29355e123613e1caf

Thanks