[xwiki-users] Fetching RSS feed content asynchronously or after specified time interval?
i have included couple of RSS feeds on a page. But when i go to that page that takes lot of time to load(around 20 secs). I understand that it is happening becuase of inclusion of RSS feed. I think what happens is everytime i click on that page, it brings the fresh content from RSS subscribed sites. My question is can we configure the time frequency so that RSS feeds are fetched after certain specified time not everytime on click of that page. It will improve the performance a lot. Here is my code that included RSS feed under tabs.If we can specify the time frequency ,it would be great. If it is not possible can we bring the RSS content of only site mentioned under first tab. Now if user further clicks on second tab, content for that rss feed is fetched that time itself instead of fetching contents of all rss feed sites at a time(or if we can make the fetching RSS feed contents asynchronously it would be amazing without imapceting page loading). {{tabs idsToLabels="tabId1=Martin Fowler, tabId2=Coding Horror"/}} (% id="tabId1" %) ((( {{box cssClass="tabId1div"}}{{/box}} {{rss feed="http://martinfowler.com/feed.atom" content="yes" width="100%"/}} ))) (% id="tabId2" %) ((( {{box cssClass="tabId2div"}}{{/box}} {{rss feed="http://feeds.feedburner.com/codinghorror/" content="yes" width="100%"/}} )))
Hi Mohit. I do not know well the RSS macro, but I think you can use the "Cache Macro": http://extensions.xwiki.org/xwiki/bin/view/Extension/Cache+Macro . When you do {{cache id="myfeeds" timeToLive="900"}} some content {{/cache}} the content is saved into the XWiki memory during 900 seconds and the scripts inside are not re-evaluated during this. I think this trick could help you. Louis-Marie 2013/6/18 Mohit Gupta <motgupta@gmail.com>
i have included couple of RSS feeds on a page. But when i go to that page that takes lot of time to load(around 20 secs). I understand that it is happening becuase of inclusion of RSS feed. I think what happens is everytime i click on that page, it brings the fresh content from RSS subscribed sites. My question is can we configure the time frequency so that RSS feeds are fetched after certain specified time not everytime on click of that page. It will improve the performance a lot.
Here is my code that included RSS feed under tabs.If we can specify the time frequency ,it would be great. If it is not possible can we bring the RSS content of only site mentioned under first tab. Now if user further clicks on second tab, content for that rss feed is fetched that time itself instead of fetching contents of all rss feed sites at a time(or if we can make the fetching RSS feed contents asynchronously it would be amazing without imapceting page loading).
{{tabs idsToLabels="tabId1=Martin Fowler, tabId2=Coding Horror"/}}
(% id="tabId1" %) ((( {{box cssClass="tabId1div"}}{{/box}}
{{rss feed="http://martinfowler.com/feed.atom" content="yes" width="100%"/}} )))
(% id="tabId2" %) ((( {{box cssClass="tabId2div"}}{{/box}}
{{rss feed="http://feeds.feedburner.com/codinghorror/" content="yes" width="100%"/}} ))) _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
On Jun 18, 2013, at 10:42 AM, Mohit Gupta <motgupta@gmail.com> wrote:
i have included couple of RSS feeds on a page. But when i go to that page that takes lot of time to load(around 20 secs). I understand that it is happening becuase of inclusion of RSS feed. I think what happens is everytime i click on that page, it brings the fresh content from RSS subscribed sites. My question is can we configure the time frequency so that RSS feeds are fetched after certain specified time not everytime on click of that page. It will improve the performance a lot.
Here is my code that included RSS feed under tabs.If we can specify the time frequency ,it would be great. If it is not possible can we bring the RSS content of only site mentioned under first tab. Now if user further clicks on second tab, content for that rss feed is fetched that time itself instead of fetching contents of all rss feed sites at a time(or if we can make the fetching RSS feed contents asynchronously it would be amazing without imapceting page loading).
Yes, modifying the RSS macro so that it loads the content asynchronously would be awesome! You should create a jira about it (and propose a pull request? ;)). Thanks -Vincent
{{tabs idsToLabels="tabId1=Martin Fowler, tabId2=Coding Horror"/}}
(% id="tabId1" %) ((( {{box cssClass="tabId1div"}}{{/box}}
{{rss feed="http://martinfowler.com/feed.atom" content="yes" width="100%"/}} )))
(% id="tabId2" %) ((( {{box cssClass="tabId2div"}}{{/box}}
{{rss feed="http://feeds.feedburner.com/codinghorror/" content="yes" width="100%"/}} )))
Thanks Guillaume. You solution worked. With this it page will be slow only first time (when it tries to fetch the fresh content). As Vincent suggested loading the content asych will be right solution as with page wont be slower even for the first time. I have raised the ticket at http://jira.xwiki.org/browse/XWIKI-9242 On Tue, Jun 18, 2013 at 3:05 PM, Vincent Massol <vincent@massol.net> wrote:
On Jun 18, 2013, at 10:42 AM, Mohit Gupta <motgupta@gmail.com> wrote:
i have included couple of RSS feeds on a page. But when i go to that page that takes lot of time to load(around 20 secs). I understand that it is happening becuase of inclusion of RSS feed. I think what happens is everytime i click on that page, it brings the fresh content from RSS subscribed sites. My question is can we configure the time frequency so that RSS feeds are fetched after certain specified time not everytime on click of that page. It will improve the performance a lot.
Here is my code that included RSS feed under tabs.If we can specify the time frequency ,it would be great. If it is not possible can we bring the RSS content of only site mentioned under first tab. Now if user further clicks on second tab, content for that rss feed is fetched that time itself instead of fetching contents of all rss feed sites at a time(or if we can make the fetching RSS feed contents asynchronously it would be amazing without imapceting page loading).
Yes, modifying the RSS macro so that it loads the content asynchronously would be awesome! You should create a jira about it (and propose a pull request? ;)).
Thanks -Vincent
{{tabs idsToLabels="tabId1=Martin Fowler, tabId2=Coding Horror"/}}
(% id="tabId1" %) ((( {{box cssClass="tabId1div"}}{{/box}}
{{rss feed="http://martinfowler.com/feed.atom" content="yes" width="100%"/}} )))
(% id="tabId2" %) ((( {{box cssClass="tabId2div"}}{{/box}}
{{rss feed="http://feeds.feedburner.com/codinghorror/" content="yes" width="100%"/}} )))
users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users
participants (3)
-
Guillaume "Louis-Marie" Delhumeau -
Mohit Gupta -
Vincent Massol