API
Version 7.x > API > Can't expire a custom cache key entry when a custom document type entry is modified View modes: 
User avatar
Certified Developer v6
Certified Developer v6
Nortech - 9/12/2013 9:27:45 AM
   
Can't expire a custom cache key entry when a custom document type entry is modified
I am aware of the caching technology that kentico cms uses, but I still have a question.

I have a custom document type whose code name is nrt.companyevent. I use custom code to get info from db and store it to cache using the following key: nodes|Main|nrt.companyevent|all. The problem is that the key in not touched when I edit an entry of this document type. For custom tables the correct syntax is customtableitem.<namespace.table-name>|all. What is the corresponding name convention for custom document types?

User avatar
Member
Member
kentico_sandroj - 9/12/2013 3:39:12 PM
   
RE:Can't expire a custom cache key entry when a custom document type entry is modified
Hello,

This blog post describes cache dependencies in detail and it covers the custom document type as well. I believe the one you are looking for is: nodes|corporatesite|cms.menuitem|all

Please let me know if you have any questions.

Best Regards,
Sandro

User avatar
Certified Developer v6
Certified Developer v6
Nortech - 9/13/2013 2:14:22 AM
   
RE:Can't expire a custom cache key entry when a custom document type entry is modified
Hi Sandro,

I have read the article that you mention.

I want to cache a dataset that contains custom document type items. So "cms.menuitem" is not good for me.

I am using the key "nodes|main|nrt.companyevent|all", but it doen't work. Any suggestions?

User avatar
Certified Developer v6
Certified Developer v6
Nortech - 9/13/2013 5:45:04 AM
   
RE:Can't expire a custom cache key entry when a custom document type entry is modified
Please ignore this post. Now it seems to work fine. The corresponding key IS touched when the document type item is modified.

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/13/2013 6:08:03 AM
   
RE:Can't expire a custom cache key entry when a custom document type entry is modified
Hi,

I was just testing it and composing the reply below and in the mean-time you posted this one :-)

I am glad it is working for you, although that was the thing I though is going on strange, key in the same format is touched when I change document on the Form tab in the CMS Desk - e.g. the document name.

Best regards,
Juraj Ondrus

User avatar
Kentico Support
Kentico Support
kentico_jurajo - 9/13/2013 6:05:50 AM
   
RE:Can't expire a custom cache key entry when a custom document type entry is modified
Hello,

Where and how exactly are you using the dummy key?
I just tried it with menu item as well as custom document type (it does not really matter) using the key above and it is working fine for me. I tested it using repeater and I have set the "Cache minutes" system setting for this web aprt to be 5 minutes, unchecked the "Use default cache dependencies" and add a touch key, in lowercase:

nodes|sitename|custom.documentype|all


and it is working fine for me. Once I change a document of this type, refresh the page - the cache is updated and new information is available on the live site right ahead.

Have you tried using the cache debug?

Best regards,
Juraj Ondrus