Prevent Sitecore editors playing around with rendering cache options

Caching of renderings is a vital part of good performing Sitecore websites. Getting all the settings right aren’t trivial and it’s really only the developers of components that knows the details about how each component can be cached. Therefore caching options are typically managed on the rendering items and kept serialized together with solution source.

However, rendering cache options can also be set on a rendering in the layouts field when it’s used on a page. This is done in the “Control Properties” dialog. Personally I’ve never found a use case where this is needed, but the option is there.

Whether a user has access to the rendering parameters in the “Control Properties” dialog is controlled by “write” access to the Standard Rendering parameters template’s standard value. Sigh!

/sitecore/templates/System/Layout/Rendering Parameters/Standard Rendering Parameters/__Standard Values

If an author has write access to this item, he or she can edit the rendering parameters. Yes, I found this really odd too!

Now, it turns out that disabling write access to this item, does not disable write access to the cache settings. Any author with component editing access can change these caching options. Sitecore has confirmed this being a bug.

Authors with no access to rendering parameters can still edit the rendering caching options.

As a workaround, one can deny field read access to the Caching section for all users. Administrators will still see those options. Simply assign deny read to sitecore\Everyone to the item /sitecore/templates/System/Layout/Rendering Parameters/Standard Rendering Parameters/Caching/Caching ({3094D236-5985-4C4F-AE6A-E30740885532})

Assign deny “Field Read” to the Standard Rendering Parameters Caching item

With this in place, authors won’t play with these settings anymore 🙂

In order to find & repair potential errors that authors have already done, we can search through the database in order to find those settings. As they are stored embedded in the layouts field, we can do this by querying the master database with the queries below:

select * from SharedFields where FieldId='{F1A1FE9E-A60C-4DDB-A3A0-BB5B29FE732E}' and (
    value like '%cac="1"%' or value like '%ciu="1"%' or 
    value like '%vbd="1"%' or value like '%vbdev="1"%' or 
    value like '%vbl="1"%' or value like '%vbp="1"%' or
    value like '%vbqs="1"%' or value like '%vbu="1"%'
)

select * from VersionedFields where FieldId='{04BF00DB-F5FB-41F7-8AB7-22408372A981}' and (
    value like '%cac="1"%' or value like '%ciu="1"%' or 
    value like '%vbd="1"%' or value like '%vbdev="1"%' or 
    value like '%vbl="1"%' or value like '%vbp="1"%' or
    value like '%vbqs="1"%' or value like '%vbu="1"%'
)

2 thoughts on “Prevent Sitecore editors playing around with rendering cache options

Comments are closed.