ppi / website

The PPI Website
http://www.ppi.io
MIT License
23 stars 15 forks source link

[Blog] Recent Comments #60

Closed dragoonis closed 12 years ago

dragoonis commented 12 years ago

Our comments are powered by Disqus - so we don't have database access to the comments.

Here's a link to the comments: http://ppiframework.disqus.com/latest.rss

dragoonis commented 12 years ago

Lets grab the top 5 in the list, add them to the cache and set it to expire every hour. This will not cause much server load. One CURL request per hour is fine.

The page is also loaded via ajax, so when the cache does expire, we don't experience any page loading problems.

dragoonis commented 12 years ago

To get the cache we do

$cache = $this->getService('blog.cache');
dragoonis commented 12 years ago

This is where that service is defined.

https://github.com/ppi/website/blob/master/modules/BlogModule/Module.php#L38

dragoonis commented 12 years ago

Examples of using the cache: https://github.com/ppi/website/blob/master/modules/BlogModule/Controller/Blog.php#L49

dragoonis commented 12 years ago

Please make a class

./modules/BlogModule/Classes/RecentComments,

See how we do things here: https://github.com/ppi/website/tree/master/modules/Application/Classes

dragoonis commented 12 years ago

Hi @alfrekjv

There isn't a mustache template on the blog/index.html.php file to add it to the blog index.

Adding this. Thanks.

dragoonis commented 12 years ago

@alfrekjv it's live, previewable here: http://dev.ppi.io/blog

Thanks for the good code! :-)