Dnn.platform: RFC: Clearing Cache Improvements

Created on 16 Oct 2018  路  12Comments  路  Source: dnnsoftware/Dnn.Platform

Request For Comments.

Please review the problem and suggested solution and provide your comments to help drive this feature implementation into a future platform release.

Description of problem

Currently clearing the cache doesn't clear everything. Mainly it's missing disk based cache items like Sitemap and Page Output cache. There are times where you'd want to just clear the sitemap or page output cache vs always clearing everything. While you can clear these items individually if you know where to go. We can easily improve this and group these items into the solution for this problem.

Description of solution

When you click clear cache, we should display a checkbox list which has Module, Portal, SiteMap, CDF, Page Output as options. If the install is in a webfarm, we should display two submit buttons. One for clear cache on this server, and one for clear cache on all servers. Finally I think a warning dialog should be displayed after submit is clicked to make triple sure the user is aware of the risk and that's the intended action.

stale

Most helpful comment

IMO we should keep this as simple as possible, Usually there should be no need for users (admins, editors and superusers) to clear the cache manually, as the framework or the module should take care of it, i.e. when an item is added, edited or deleted. If we add a cache management panel, we may make developers lazy not to clear the cache programmatically, but just tell the users to "hit the clear output cache button". Object cache is a bit different, as it is needed, whenever an update has been performed in the database (it would be helpful to add this button to the SQL tab in PB as well.

All 12 comments

We will also want to make sure these items are included as commands in prompt and each item could be cleared individually or together all at once.

I think we should also expose a new cache panel in the edit bar. When the user switches into edit mode, we should warn them with a visual indicator when page output caching or module caching is enabled. Clicking on this visual indicator would then display the details of how caching is configured for that page and the modules. We'd want to show expiration eta, the amount of variations cached, maybe the size of the cache for that page. This overlay would then expose a method for the content editor to clear the cache, this would be scoped to the current tab and hopefully help reduce the amount of times people clear the cache for the entire application when they really want to just remove a couple keys related to a single page or a single module.

IMO we should keep this as simple as possible, Usually there should be no need for users (admins, editors and superusers) to clear the cache manually, as the framework or the module should take care of it, i.e. when an item is added, edited or deleted. If we add a cache management panel, we may make developers lazy not to clear the cache programmatically, but just tell the users to "hit the clear output cache button". Object cache is a bit different, as it is needed, whenever an update has been performed in the database (it would be helpful to add this button to the SQL tab in PB as well.

@sleupold If we limit the cache to only clear the current page or an individual module the penalty isn't anywhere as severe clearing the entire cache for the application as a host user. I'd also like to add an event which could be used if a cdn is configured and you'd like to refresh objects cached at the cdn provider.

I love this idea overall, but agree with Sebastian's point of keeping things super-simple.

Is it documented anywhere exactly what the Settings > Servers > Clear Cache button does right now? That feels like it'd be a good place to start.

(Is it even a known quantity, or does someone need to go and look in the code?)

We will also want to make sure these items are included as commands in prompt and each item could be cleared individually or together all at once.

Absolutely 100% of yes. Perhaps even before exposing them in the point and click UI.

@OllyHodgson I didn't check documentation, but it currently affects object cache only (usually cached database objects - if a module uses the cache at all). Module output cache should be cleared by the module during update and ideally page cache would be invalidated as soon as any module request an output cache invalidate.
As much as I like to support extension developers, we should not provide a mechanism to fix their faults using a platform button, otherwise they might not even try to fix their bug.

We also might need to limit page caching options - if not all modules on the page support output caching, this option should be disabled.

As much as I like to support extension developers, we should not provide a mechanism to fix their faults using a platform button, otherwise they might not even try to fix their bug.

The problem is we often have to work with the modules that are there, and we need some way to work around those issues, so even thought the clear cache button can have big warnings, we still need it around in some cases. Even assuming all correct modules, we still need that for troubleshooting issue to know if they are caused by cache, it is not easy to know what is in cache as far as I know.

Is this ready to split up into individual actionable items, the way I understand this, there is already methods to clear those individual cache parts in the core, we just need to build the UI for this right?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

This issue has been closed automatically due to the aforementioned detection of activity. Feel free to re-open the issue if you believe it should not be closed.

Was this page helpful?
0 / 5 - 0 ratings