This is the community forum. For a developer response use the Client Area.
Follow us on Facebook, Twitter and YouTube!

Integration to CDN API
#1

I started marking almost all my pages as cacheable so CDN can serve them faster. Of course, comments are dynamic.

I have API to clear pages from the CDN's cache. I would like to call that API after comments have been approved/deleted. Any suggestions, to where (which file) should I place my custom code to clear the page from the CDN cache?
Reply
#2

Sure, so if you open /system/library/comment.php, you'll see these two methods ..

createComment()
deleteComment()

.. which are self-explanatory.

Then if you open /backend/model/manage/comments.php, you'll see the singleApprove() method. That method covers both single approving and bulk approving (when ticking the checkboxes on the 'Manage -> Comments' page).

If you think it's a good idea, I'll add a hook in the next version so people can add this kind of code to just one place that won't get overwritten when upgrading.

Have you completed the interview?
Reply
#3

Thanks for the reply. I think a post-hook is a good idea. People may want to perform some additional tasks after the (public) content has changed so post-hook code in a single place would be perfect.

Niko
Reply


Possibly Related Threads…
Thread / Author Replies Views Last Post
Last Post by paulkienitz
06-Dec-2024, 08:53 PM
Last Post by Steven
23-Jan-2019, 02:07 PM
Last Post by news
18-Dec-2017, 09:15 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)