• Resolved crazy-weasel

    (@crazy-weasel)


    Hi there!

    I was asked to help to increase the performance of a website which uses this plugin. Pages with embedded Flickr-galleries take quite some time to load. In Query Monitor I can see, that everytime the page is rendered multiple calls to the flickr-api are made (because there are multiple galeries per page) and each of this calls takes up to one second.

    JS-Mode would be one way to mitigate the problem, but then the spinner is displayed for serveral seconds.

    A better approach would caching of the api results, which would also tackle the problem of running into the api-rate-limit of flickr.

    For now I wrote my own plugin hooking into the http-hooks of wordpress, but it would be better if your plugin could handle caching of api calls (for all the other supported plattforms)

    What do you think? Are there any plans to store api results in the transients?

    Greetings, Alex

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Sayontan Sinha

    (@sayontan)

    What do you think? Are there any plans to store api results in the transients?

    No, there are no plans to do this at any point of time. The whole point of Photonic is to retrieve real-time results during page loading, so caching will not be built in. Photonic handles parallel calls when possible (for pulling collections), but in all other cases, the issue is with how WordPress itself renders shortcodes sequentially instead of in parallel.

    Note that the API rate limit for Flickr rarely, if ever, ends up being an issue. Flickr lets you do 3600 queries per hour, and apart from Collections, other Flickr constructs use 1-2 queries per gallery. Unless you are being subjected to a DDOS attack, or you have hundreds of visitors an hour, rate limits are not reached. Photonic has supported Flickr for 10 years now, and I have never encountered any user who had a rate limit issue.

    You are probably aware, but you can always use a separate caching plugin for this sort of behaviour. Except for Google Photos, a third party caching plugin will work fine for all platforms by caching your entire page. For Google Photos you are advised to combine a caching plugin with the JS mode. Of course, if you are using a caching plugin, you will be responsible for refreshing your cache if your source content changes, but that is true regardless of which plugin implements caching.

    Thread Starter crazy-weasel

    (@crazy-weasel)

    Thank you for your fast reply!

    Okay, I understand your view on it. 🙂

    Yes, I’m aware of the several caching plugins but in the current case they’re not feasible (because they break other features of the site)

    In the current case I’ll just stick with my http-cache implementation.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Caching Api Calls to Flickr?’ is closed to new replies.