WordPress.org

Ready to get started?Download WordPress

Forums

Twitter Widget Pro
[resolved] Huge performance issues (5 posts)

  1. khromov
    Member
    Posted 1 year ago #

    The widget seems to contact Twitter on every page load.

    This means that the render times on my site go up from 0.2 seconds to well above 1 seconds, a 5x performance decrease.

    Is it possible to use some sort of caching mechanism, where the tweets would be kept locally (in your own database) for a specific amount of time, like an hour?

    http://wordpress.org/extend/plugins/twitter-widget-pro/

  2. Aaron D. Campbell
    Member
    Plugin Author

    Posted 1 year ago #

    The plugin does cache. Specifically it caches for 5 minutes before it tries to contact Twitter again and even then keeps the old data around until it successfully reconnects to Twitter (trying every 2 minutes until it does). The data is stored as an option with another option holding the expiration time. This is actually per-unique-widget, so if you have the widget in two places displaying different tweets (different user or list, or even just different settings like showing/hiding retweets) then it will store two separate sets of data and make two different requests to Twitter every 5 minutes. This is for the FRONT end of the site where the widgets are displayed.

    In wp-admin, on the Twitter Widget pro settings page and the widgets page, it makes calls on every page load because it is verifying that the authorization is in place, getting current rate limits, etc.

  3. khromov
    Member
    Posted 1 year ago #

    It must be a bug then, because I am positive it checks Twitter every pageload, as I can see the "Remaining: X" counter decrease every time I reload a page containing a Twitter widget.

    I've tried completely removing the plugin and reinstalling, same issue.

    Any ideas?

  4. Aaron D. Campbell
    Member
    Plugin Author

    Posted 1 year ago #

    I just tested this on three of my sites on three different servers. I set several of the pages with the widgets on them to auto-refresh every 5 seconds (so I was getting 3 page loads every 5 seconds). Two of these showed the @RangeInc feed and all three showed @aaroncampbell. After letting that run for 5-10 minutes I still have over 170 (of my 180) requests available for both accounts.

  5. khromov
    Member
    Posted 1 year ago #

    Hey Aaron,

    After some troubleshooting I found that this is an issue with W3 Total Cache.

    Specifically, when Object Cache is enabled, transients freak out and seem to be recalculated on every pageload. This affects other plugins but only those that make remote calls seem problematic due to opcode caching picking up most of the slack on the local recalculations.

    You have been very helpful, and the plugin now functions correctly after disabling W3 Object Cache. Thanks again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic