{"action":"created","issue":{"url":"https://api.github.com/repos/RyanBayne/TwitchPress/issues/162","repository_url":"https://api.github.com/repos/RyanBayne/TwitchPress","labels_url":"https://api.github.com/repos/RyanBayne/TwitchPress/issues/162/labels{/name}","comments_url":"https://api.github.com/repos/RyanBayne/TwitchPress/issues/162/comments","events_url":"https://api.github.com/repos/RyanBayne/TwitchPress/issues/162/events","html_url":"https://github.com/RyanBayne/TwitchPress/issues/162","id":269395602,"node_id":"MDU6SXNzdWUyNjkzOTU2MDI=","number":162,"title":"Stagger API Calls for multiple uses of the same shortcode","user":{"login":"RyanBayne","id":25900125,"node_id":"MDQ6VXNlcjI1OTAwMTI1","avatar_url":"https://avatars0.githubusercontent.com/u/25900125?v=4","gravatar_id":"","url":"https://api.github.com/users/RyanBayne","html_url":"https://github.com/RyanBayne","followers_url":"https://api.github.com/users/RyanBayne/followers","following_url":"https://api.github.com/users/RyanBayne/following{/other_user}","gists_url":"https://api.github.com/users/RyanBayne/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanBayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanBayne/subscriptions","organizations_url":"https://api.github.com/users/RyanBayne/orgs","repos_url":"https://api.github.com/users/RyanBayne/repos","events_url":"https://api.github.com/users/RyanBayne/events{/privacy}","received_events_url":"https://api.github.com/users/RyanBayne/received_events","type":"User","site_admin":false},"labels":[{"id":591548951,"node_id":"MDU6TGFiZWw1OTE1NDg5NTE=","url":"https://api.github.com/repos/RyanBayne/TwitchPress/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-10-29T12:33:28Z","updated_at":"2018-10-13T10:45:16Z","closed_at":"2018-10-13T10:45:16Z","author_association":"OWNER","body":"Consider the same shortcode being used multiple times on the same page. It would result in multiple calls which cannot be avoided initially unless the API offers an endpoint for returning multiple channels in a single object. \r\n\r\nThat has to be explored first. Can the existing basic shortcodes be adapted to allow multiple channel ID or usernames to be passed in a new parameter and encourage that approach?\r\n\r\nSecondly, we need to consider the cache and logging. I don't like logging within shortcodes unless it is very important. My point is it may be best to offset transient caches so they do not all start and expire at the same time. By staggering them the content on a page would have a mix of timestamps but they wouldn't be more than a few seconds apart. \r\n\r\nEither add 1 to 30 seconds random expiry time to the existing 120 seconds or detect multiple uses of the same shortcode using a global variable and add a specific number of seconds to the cache expiry i.e. 5 seconds would do. \r\n\r\nA scenario I considered is someone creating a \"My Fave 100 Streamers\" page which is an extreme example but even \"Top 10 Star Citizen Streamers\" might warrant special design changes. The best scenario is to create a shortcode that does these things especially but I've created this issue to explore the innovative approaches that users might deploy when using the existing basic shortcodes. \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/RyanBayne/TwitchPress/issues/comments/429531975","html_url":"https://github.com/RyanBayne/TwitchPress/issues/162#issuecomment-429531975","issue_url":"https://api.github.com/repos/RyanBayne/TwitchPress/issues/162","id":429531975,"node_id":"MDEyOklzc3VlQ29tbWVudDQyOTUzMTk3NQ==","user":{"login":"RyanBayne","id":25900125,"node_id":"MDQ6VXNlcjI1OTAwMTI1","avatar_url":"https://avatars0.githubusercontent.com/u/25900125?v=4","gravatar_id":"","url":"https://api.github.com/users/RyanBayne","html_url":"https://github.com/RyanBayne","followers_url":"https://api.github.com/users/RyanBayne/followers","following_url":"https://api.github.com/users/RyanBayne/following{/other_user}","gists_url":"https://api.github.com/users/RyanBayne/gists{/gist_id}","starred_url":"https://api.github.com/users/RyanBayne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RyanBayne/subscriptions","organizations_url":"https://api.github.com/users/RyanBayne/orgs","repos_url":"https://api.github.com/users/RyanBayne/repos","events_url":"https://api.github.com/users/RyanBayne/events{/privacy}","received_events_url":"https://api.github.com/users/RyanBayne/received_events","type":"User","site_admin":false},"created_at":"2018-10-13T10:45:16Z","updated_at":"2018-10-13T10:45:16Z","author_association":"OWNER","body":"This entire problem will be solved by caching call results for short-term. This is something that is slowly being designed for use in Twitch API 6."}}
{"actor":{"display_login":"RyanBayne"}}