Implementing Model-level caching

前端 未结 8 1520
孤城傲影
孤城傲影 2021-01-31 00:28

I was posting some comments in a related question about MVC caching and some questions about actual implementation came up. How does one implement a Model-level cache that works

8条回答
  •  旧巷少年郎
    2021-01-31 01:02

    You should have a seperate Model which does the SQL interfacing directly, eg. for a Customers table: $CustomerModel->GetCustomers($parameter); et cetera. Then, in those models, you can implement caching transparently without having to edit any of your existing MVCs.

提交回复
热议问题