开发者

Caching scheme for two sites that share DB

开发者 https://www.devze.com 2023-02-06 11:19 出处:网络
Let\'s assume I have two sites around one DB. The first is based on FatFreeCRM and handles the business logic, let\'s call it site_1 and the second one is based on RadiantCMS and handles presentation

Let's assume I have two sites around one DB. The first is based on FatFreeCRM and handles the business logic, let's call it site_1 and the second one is based on RadiantCMS and handles presentation logic. Let's call it site_2 Some of the pages in RadiantCMS use models from FatFreeCRM (mostly to show them, not to modify).开发者_Go百科 And from FatFreeCRM I am able to add/remove/modify some instances of models.

The problem is that I want these pages in RadiantCMS to be cached. But I can't expire cache directly from FatFreeCRM.

What is the best cache strategy for this case?

Thank you.


I would suggest creating an API on RadiantCMS that allows you to expire certain cached pages. For example:

site_1.com/api/expire/sldfj2389283kd

You could then call this expire action from FatFreeCRM anytime you want to expire a certain key or collection of keys, and perform the actual cache expiration on RadiantCMS.

0

精彩评论

暂无评论...
验证码 换一张
取 消