ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Twitter timeline plugin won't cache

December 01, 2010 1:55pm

Subscribe [4]
  • #1 / Dec 01, 2010 1:55pm

    metadaptive

    96 posts

    Hello,

    I’m having trouble with the officical twitter timeline plugin under EE1.7.0. The plugin displays tweets just fine, but it never seems to cache data, resulting in a 1.5-2 second addition to each page load while the plugin fetches fresh data.

    {exp:twitter_timeline 
        screen_name="username"
        limit="5"
        create_links="user_mentions|hashtags|urls"
        twitter_refresh="30"
        }
      <div class="tweet">
          
          <div class="author">
              <div class="icon">
                  {profile_image_url}
              </div>
              
          </div>
          <div class="status">{text}</div>
          <div class="date">{created_at format="posted at %g:%i on %d/%m/%y"}</div>
      </div>
      {/exp:twitter_timeline}

    My template debug output looks something like this (not that it tells you a whole lot):

    (0.756230)           Tag: {exp:twitter_timeline screen_name="username" limit="5" create_links="user_mentions|hashtags|urls" twitter_refresh="30" }
    (0.756414)           Closing Tag Found
    (0.756515)           Processing Tags
    (0.756567)           Plugin Tag: Twitter_timeline/twitter_timeline
    (0.756587)           Including Files for Tag and Modules
    (0.758314)           Beginning Final Tag Data Processing
    (0.758342)           Calling Class/Method: Twitter_timeline/twitter_timeline
    (0.758552)            -> Class Called: Twitter_timeline
    (0.758611)           Using 'user' Twitter Timeline For User username
    (0.758666)           Fetching Twitter timeline remotely
    (2.270401)            -> Method Called: twitter_timeline
    (2.270433)            -> Data Returned
    (2.270502)            - End Tag Processing -

    It does that every time, even if the tag was called a few seconds ago. I’ve tried enabling/disabling tag caching and template caching but to no avail.

    Any ideas?

  • #2 / Dec 02, 2010 8:27am

    Sue Crocker

    26054 posts

    In my local install, I get this back:

    (0.046437) Tag: {exp:twitter_timeline screen_name="shecodes" limit="5" create_links="user_mentions|hashtags|urls" twitter_refresh="30" }
    (0.046698) Closing Tag Found
    (0.046851) Processing Tags
    (0.046942) Plugin Tag: Twitter_timeline/twitter_timeline
    (0.046989) Including Files for Tag and Modules
    (0.065905) Beginning Final Tag Data Processing
    (0.065939) Calling Class/Method: Twitter_timeline/twitter_timeline
    (0.066221) -> Class Called: Twitter_timeline
    (0.066283) Using 'user' Twitter Timeline For User shecodes
    (0.066356) Fetching Twitter timeline remotely
    (1.607616) -> Method Called: twitter_timeline
    (1.607639) -> Data Returned
    (1.607691) - End Tag Processing -
    (1.607823) - End Template Processing -
    (1.607833) Parse Global Variables
    (1.609443) Template Parsing Finished

    I have no caching of any kind going on.. are you seeing latency on any other part of the site?

  • #3 / Dec 02, 2010 9:11am

    metadaptive

    96 posts

    Hey Sue,

    No, no latency issues with the rest of the site. Aside from the twitter plugin my total template render times on the live site are around 0.3-0.5 seconds. It’s only the twitter plugin that is running slow.

    Do you get the same debug output on subsequent pageloads?

    Given that you have twitter_refresh=“30” set, surely the plugin ought to cache the selected timeline for later use the first time it’s called (as it says it does in the docs)?

    The “Fetching Twitter timeline remotely” log output and the 1.6 second delay would indicate that the said caching is not happening. Additionally, setting cache=“yes” and refresh=“30” as suggested in the plugin docs (http://expressionengine.com/downloads/details/twitter_timeline/) also appears to have no effect on the time the plugin takes to return data.

  • #4 / Dec 03, 2010 2:14am

    John Henry Donovan

    12339 posts

    metadaptive,

    Can you confirm that you have the correct permissions (777) on your cache folder?
    Has a twitter_timeline folder been automatically created?

  • #5 / Dec 03, 2010 7:51am

    metadaptive

    96 posts

    D’oh! Good call John… cache folder had got set to 775 somehow… my bad for not checking. Many thanks for your help though!

  • #6 / Dec 03, 2010 9:45am

    Ingmar

    29245 posts

    So, does that resolve the issue?

  • #7 / Dec 03, 2010 9:52am

    metadaptive

    96 posts

    yes indeed, thanks all…

  • #8 / Dec 03, 2010 9:56am

    Ingmar

    29245 posts

    Excellent. Post again as needed, please.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases