${_('Invalidate Cache for Repository')}

${_('Manually invalidate the repository cache. On the next access a repository cache will be recreated.')}

${_('Cache purge can be automated by such api call. Can be called periodically in crontab etc.')}
${h.api_call_example(method='invalidate_cache', args={"repoid": c.rhodecode_db_repo.repo_name})}

${h.secure_form(h.route_path('edit_repo_caches', repo_name=c.repo_name), request=request)}
${h.submit('reset_cache_%s' % c.rhodecode_db_repo.repo_name,_('Invalidate repository cache'),class_="btn btn-small",onclick="return confirm('"+_('Confirm to invalidate repository cache')+"');")}
${h.end_form()}

${(_ungettext('List of repository caches (%(count)s entry)', 'List of repository caches (%(count)s entries)' ,len(c.rhodecode_db_repo.cache_keys)) % {'count': len(c.rhodecode_db_repo.cache_keys)})}

%for cache in c.rhodecode_db_repo.cache_keys: %endfor
${_('Key')} ${_('State UID')} ${_('Namespace')} ${_('Active')}
${cache.cache_key} ${cache.cache_state_uid} ${cache.cache_args} ${h.bool2icon(cache.cache_active)}

${_('Cache keys')}

Cache keys used for storing cached values of repository stats, file tree history and file tree search. Invalidating the cache will remove those entries.

region: ${c.region.name}
backend: ${c.region.actual_backend.__class__}
% if c.rhodecode_user.is_admin:
store: ${c.region.actual_backend.get_store()}
% else:
store: ${c.region.actual_backend.get_store().__class__}
% endif

% if c.repo_keys:
${len(c.repo_keys)} ${_('Show all')}

% else:
 NO KEYS FOUND
% endif

${_('Shadow Repositories')}

% if c.shadow_repos: % for shadow_repo in c.shadow_repos: % endfor % else: % endif
${shadow_repo}
${_('No Shadow repositories exist for this repository.')}

${_('Diff Caches')}

% if c.rhodecode_user.is_admin: % else: % endif
${_('Cached diff name')}:${c.rhodecode_db_repo.cached_diffs_dir}${c.rhodecode_db_repo.cached_diffs_relative_dir}
${_('Cached diff files')}: ${c.cached_diff_count}
${_('Cached diff size')}: ${h.format_byte_size(c.cached_diff_size)}