# 404-solution/trunk/includes/html/toolsCacheForm.html

404 Solution, version trunk. 50 lines.

- Page: https://pluginprobe.com/plugins/404-solution/trunk/code/includes/html/toolsCacheForm.html
- Raw: https://pluginprobe.com/plugins/404-solution/trunk/raw/includes/html/toolsCacheForm.html
- Modified: 2025-11-20T14:18:22+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/404-solution/trunk/code/includes/html/toolsCacheForm.html#L10-L20`.

```html
<form method="POST" name="tools-cache-ngram" action="{toolsNgramCacheFormActionLink}" style="display:inline-block; margin-right: 10px;" id="abj404-ngram-rebuild-form">
    <input type="hidden" name="action" value="rebuildNgramCache">
    <p>
        <strong>{N-gram Cache}</strong>
    </p>
    {Rebuild the N-gram spell checker cache. This optimizes 404 URL matching performance. May take several minutes on large sites.}
    <BR/>
    <input type="submit" value="{Rebuild N-gram Cache}" class="button-secondary" id="abj404-rebuild-ngram-btn">
</form>

<script type="text/javascript">
(function($) {
    $(document).ready(function() {
        $('#abj404-ngram-rebuild-form').on('submit', function(e) {
            var btn = $('#abj404-rebuild-ngram-btn');
            var originalText = btn.val();
            var countdown = 5;

            // Disable button immediately
            btn.prop('disabled', true);
            btn.val('{Rebuilding...} (' + countdown + 's)');

            // Countdown timer
            var interval = setInterval(function() {
                countdown--;
                if (countdown > 0) {
                    btn.val('{Rebuilding...} (' + countdown + 's)');
                } else {
                    clearInterval(interval);
                    btn.prop('disabled', false);
                    btn.val(originalText);
                }
            }, 1000);

            // Let the form submit normally
        });
    });
})(jQuery);
</script>

<form method="POST" name="tools-cache-spelling" action="{toolsSpellingCacheFormActionLink}" style="display:inline-block;">
    <input type="hidden" name="action" value="clearSpellingCache">
    <p>
        <strong>{Spelling Cache}</strong>
    </p>
    {Clear the spelling cache to force recalculation of URL matches. Useful after making significant content changes.}
    <BR/>
    <input type="submit" value="{Clear Spelling Cache}" class="button-secondary">
</form>

```
