• Resolved vebbmaster

    (@vebbmaster)


    Hello! The plugin is great and works very well, except for one thing… It seems to add at least 600 ms to the page load time and it does the IP lookup before loading the rest of the page.

    Is there an easy way to delay the lookup, or wait until the page is completely loaded?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Benjamin Pick

    (@benjamin4)

    Which source are you using? If you’re using the Maxmind file-based (automatic), 600ms seems too much. Web-based sources will have this (hostinfo/Maxmind Precision).

    Defer the lookup to do it after the page load will be possible when the AJAX functionality is ready. https://www.ads-software.com/support/topic/js-api/ But as you see there, I cannot say when I come to it …

    Thread Starter vebbmaster

    (@vebbmaster)

    That’s the one I’m using (file-based, automatic). AJAX functionality would be great, I’ll keep an eye out for updates from you. ??

    I was trying to delay it myself using jQuery, and at one point an external file with the lookup in it, but it didn’t work like I wanted it to. I’m not very good. :p

    Plugin Author Benjamin Pick

    (@benjamin4)

    There is a proof of concept in the AJAX thread of this – I didn’t try it but I suspect it works …

    Plugin Author Benjamin Pick

    (@benjamin4)

    But 600ms for a file-based lookup is still surprising to me (in my test it was < 10ms).

    If you do the lookup in the backend (Lookup module), does he also indicate a lookup time of 600ms? If not I wonder where this extra time is coming from. Or is it the initialization of the plugin, i.e. difference between activated or not activated, even if there is no lookup in the code?

    Thread Starter vebbmaster

    (@vebbmaster)

    When I tested in the backend, it says “Lookup duration: 0.01046 s”.

    This is what I have in the code: [geoip_detect2_get_client_ip] – [geoip_detect2 property=’city’] [geoip_detect2 property=’country’]

    If I remove those shortcodes, it goes down from ~610 ms wait to ~10 ms for the page. Not sure what specifically is causing it.

    Plugin Author Benjamin Pick

    (@benjamin4)

    10ms sounds like you are using a page cache? In this case yes it does make a big difference if any GeoIP code is included or not – because the plugin automatically tells the caching system to not cache this page. So yes, your only option is the AJAX way above.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Delay the plugin?’ is closed to new replies.