I have a situation where my Modx cache is not working and it seems to be related to a template variable. I have pinned it down to a Template Variable with items in a check box. I call this TV "type". If it is attached to my template the pages will not cache. Unattached and the pages cache properly again.
MySQL: 0.0018 s, 1 request(s), PHP: 0.0485 s, total: 0.0503 s, document retrieved from cache.
MySQL: 0.0073 s, 8 request(s), PHP: 0.0710 s, total: 0.0783 s, document retrieved from database
On the outside chance, maybe this is normal as a checkbox TV will disable pages from being cached. It is a significant TV as it filters dittos etc, etc., and it would be great to get the cache back up and running.
It started right around my upgrade to Evo 1.03, but I cannot be certain that the upgrade had anything to do with this.
Thank you!
"Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
-J.R.R. Tolkien from The Lord of the Rings
-
☆ A M B ☆
- 24,524 Posts
This is definitely not normal. TVs have nothing to do with caching/not caching. The only thing I can think of is some kind of variable name conflict. Or possibly some weird thing causing the cache file to fail to write, but that should throw an error. Does the System Events log have anything (Reports -> System Events)
Hi Susan, The System Events log is clean. The variable names are shown in the image and I have copied them below. I am not aware of a variable name conflict on the variables below.
Article==article||Event==event||Brand==brand||Fashion==fashion||Ready Wear==readywear||Technical Textile==technical||Performance Textile==performance||Home Textiles==home
Also I used to get 0 database requests and the document called from cache but now when I turn off that TV I still see 1 database request and the document called from cache on pages that I do not believe have any uncached snippets. Is it normal to have database requests on pages that say they are cached?
Thank you.
"Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
-J.R.R. Tolkien from The Lord of the Rings
-
☆ A M B ☆
- 24,524 Posts
If it has an uncached snippet that calls the database for anything, such as Ditto or Wayfinder, yes.
Then that part is ok, it is just what is happening with the TV with check boxes. Thanks
"Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
-J.R.R. Tolkien from The Lord of the Rings
-
☆ A M B ☆
- 24,524 Posts
Are you sure you aren’t seeing the page being retrieved from the database because the cache was cleared when you save the resource?
Yes I am sure. I have had this caching problem for several weeks--as I said it popped up right at the time when I upgraded to Evo 1.03--and started to pin it down when I saw pages (resources) that were caching properly when they were using no template as they were being used in Jquery tabs. When I would clear the cache only these resources would clear. That is when I went looking for what was being attached to my template. I disabled each TV until I found the culprit. Then went back and checked this a couple of times on two server installations.
"Remember what Bilbo used to say: It's a dangerous business, Frodo, going out your door. You step onto the road, and if you don't keep your feet, there's no knowing where you might be swept off to."
-J.R.R. Tolkien from The Lord of the Rings
-
☆ A M B ☆
- 24,524 Posts
Hmmm. I have never noticed such a thing, and I use radio button and checkbox TVs a lot. I’ll check it out.
-
☆ A M B ☆
- 24,524 Posts
As I suspected, it’s the name of your TV ("type"). Give it another name, and it’ll work just fine.
The problem is that in the document parser the variable named "type" is used for the type of resource (document or reference). So getting a TV’s array instead of the resource type of "document" it never caches the page.
Somehow the TV is inserted into the documentObject array instead of the value from the site_content table. It is definitely a bug. As soon as I pin down just where it’s happening I’ll post it to the Jira bugtracker.
-
☆ A M B ☆
- 24,524 Posts
Just a question that came to mind when working with this. It’s a radio button TV. It can only have one output item. Why do you have it formatted to output a comma-delimited list?