T
T
Timur2013-06-29 14:09:53
Yii
Timur, 2013-06-29 14:09:53

Yii: Dependency caching on two CFileCacheDependency. Is it possible to?

The situation is this: I have my own renderer that renders pages from two files (layout.html and content.html), the result is minified and cached using CFileCache.
I need to reset the cache when these files change. CFileCacheDependency allows you to set only one file, and CDirectoryCacheDependency practically negates the results of caching, because. there are a lot of files in the templates folder.
The layout.html and content.html files are in different directories. In my case, this is a necessary condition
. Can you please tell me how to install a dependency on two files? Is that possible?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KingOfNothing, 2013-06-29
@XAKEPEHOK

Well, two options:
1) Extend the CFileCacheDependency class by creating a CMultipleFileCacheDependency and define logic for two files
2) Use a CChainedCacheDependency, put two CFileCacheDependencies in it The
second option seems to be winning.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question