Naming caches dynamically
-
While I’m hoping I can figure out how to optimize my code so things run faster, I realize that there’s no downside to me using caches to speed things up. My pages will mostly not be updated daily, so if there’s a day lag it’s not the end of the world. I could even make it a week without worrying. What I realized, however, is that many pages on my site use exactly the same code pulled in from an external template file. The only content in most of my pages is a load tag pointing to the external file. Since caches need to be named, I need to name each cache dynamically somehow. My first thought was something like:
[cache name=cache-[field id] expire='1 day']
but obviously I can’t do that. So then I thought about passing the id like:
[pass field=id] [cache name=cache-{FIELD} expire='1 day']
but the page already has two other nested [pass] tags and it doesn’t seem to want to deal with a third.
So my question is if there is another way to create a unique cache name for these pages?
Thanks.
- The topic ‘Naming caches dynamically’ is closed to new replies.