Global Cache Working too well? I have a long entry list of authors and I am using global cache to help with the page load, but this global cache prevents the if statement from adding selected to the appropriate option. When I remove the global cache everything performs as intended.

&lt;select name="filter-by-author" onchange="window.location.href=this.value;"&gt;
    &lt;option value="/blog"&gt;All Authors&lt;/option&gt;
        {% cache globally %}
            {% nav author in craft.users({ group: 'blogAuthors', order: 'firstName', limit: null }) %}
                &lt;option value="{{ url('blog/author/'~author.username) }}"
                {% if craft.request.getLastSegment() == author.username %}selected{% endif %}&gt;
                {{ author.name | title }}
                &lt;/option&gt;
            {% endnav %}
        {% endcache %}
&lt;/select&gt;
This is exactly what caching is supposed to do... flatten the Twig code down to basic HTML, and serve that up instead of dynamically rendering it. Using globally means that the HTML would be identical on every page, which is not really what you want here.

Get rid of globally, so it can cache separately for each page. Since the URL is supposed to affect how that snippet is rendered, you don't want to cache globally.