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

  1. Marteens
    Posted 3 years ago #


    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
    Posted 3 years 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:


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

  3. Marteens
    Posted 3 years ago #

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

  4. Marteens
    Posted 3 years ago #

    or maybe WP Object Cache?

  5. Marteens
    Posted 3 years 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
    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic