WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cache a footer-widget for a short time period (6 posts)

  1. Marteens
    Member
    Posted 1 year ago #

    Hi.

    Is it possible to cache my footer-widget for let's say 5-10 minutes, so it doesn't reload on every page? I use the same footer on every page anyway.

    Here is why I need it:

    I use Weather and Weather Forecast Widget, which is a great plugin for weather forecast. With the free API key, I do have limits on how many queries I can make. I can't go over 10 in a minute or over 500 in a day.

    Now, since I have this in my footer on every page, I often go over 10 queries in a minute, and then my API key gets blocked for the rest of the day.

    So I was thinking.. If I somehow don't have to make a new call for everytime I open a page, then my problem is solved. The wheater doesn't change much in 5-10 minutes anyway. But how can I do this?

    Thank you!

  2. Marteens
    Member
    Posted 1 year ago #

    Ok. Let's try someting else..

    The widget I use have this function allready installed.. And I have set the cache time to 3600 s (one hour).. But still I keep going over the "10 in a minute"-limit.. How is that even possible? That has to mean that the cache function is not working, right?

    I tried to look at the php. file, and it looks like this:

    http://pastebin.com/in7qEx9u

    I have no clue what I should do, is there someone who has any idea?

  3. Marteens
    Member
    Posted 1 year ago #

    Searching for answers , I came across Transients API.. Is this what I am looking for?

  4. Marteens
    Member
    Posted 1 year ago #

    or maybe WP Object Cache?

  5. Marteens
    Member
    Posted 1 year ago #

    Is there no way I can save the information I get about the weather and then just use that for the next 10 minutes? This way I don't have to ask again two seconds later when I open a new page.

  6. Marteens
    Member
    Posted 1 year ago #

    WP Widget Cache was just what I was looking for. :)

Topic Closed

This topic has been closed to new replies.

About this Topic