Clearing the cache when saving a template

Galen King's Avatar

Galen King

04 Jul, 2011 04:07 AM via web

I've made a change to a partial but it's not reflected in the site until I edit and save a page. Is there a way to clear the entire cache or can you please do it for me?

Thanks,

Galen

  1. 2 Posted by Jonathan Hoyt on 05 Jul, 2011 02:38 PM

    Jonathan Hoyt's Avatar

    Hi Galen, thanks for getting in touch. Sorry about the delay in answering. I've tested this on several sites and not been able to duplicate the issue as of yet.

    Right now if I go in and edit an include then click refresh on a page that includes that, it has the change. Is this not what you are experiencing?

    I guess I need some more details about your situation so we can try and track this down. Thanks!

  2. 3 Posted by Galen King on 05 Jul, 2011 08:28 PM

    Galen King's Avatar

    For example, even the homepage of Lucid Design is broken (there is nothing
    before the | in the meta title): http://luciddesign.co.nz/

    If I edit that page and just hit save, it fixes it.

    On 6 July 2011 02:37, Jonathan Hoyt <
    ***@tenderapp.com> wrote:

  3. 4 Posted by Jonathan Hoyt on 06 Jul, 2011 03:18 PM

    Jonathan Hoyt's Avatar

    Galen, still looking into this, hoping to have an answer by end of today.

  4. 5 Posted by John Nunemaker on 06 Jul, 2011 09:46 PM

    John Nunemaker's Avatar

    Galen,
    Jon and I looked into the issue just now. Rest assured there are no caching issues. The problem was the logic to determine the page title. You had:

    <title>{% if item.data.html_title != "" %}{{ item.data.html_title | truncatewords: 9 }}{% elsif item.data.descriptive_title != "" %}{{ item.data.descriptive_title | truncatewords: 9 }}{% else %}{{ item.title }}{% endif %} | Lucid Design, Nelson</title>
    

    That was, for some reason, causing the first if statement to be true when it shouldn't be. Better than detecting a blank string is to check for the size of the custom data. We tweaked it to the following:

    <title>{% if item.data.html_title.size > 0 %}{{ item.data.html_title | truncatewords: 9 }}{% elsif item.data.descriptive_title.size > 0 %}{{ item.data.descriptive_title | truncatewords: 9 }}{% else %}{{ item.title }}{% endif %} | Lucid Design, Nelson</title>
    

    It now appears to be working perfectly on Lucid's site. You'll see on the dashboard that I updated the About Us page to test that our solution worked for you. Hope it is ok that we just dug in and fixed it.

    Please let us know if you run into any other issues or if we somehow misunderstood and did not solve the problem correctly.

    Thanks for continuing to put harmony through its paces!

  5. 6 Posted by Galen King on 06 Jul, 2011 10:20 PM

    Galen King's Avatar

    Thanks, that's great. Much appreciated.

    The reason I thought it was cache-related was because if I simply edited and
    saved the page, it worked. I used to test for {% if item.title %} and that
    would return false if it was blank but that doesn't seem to work now. What
    about item.title.blank? and item.title.empty tags? Do they not work reliably
    either?

    Thanks for fixing. Totally happy for you to do that.

    Cheers,

    Galen

    On 7 July 2011 09:48, John Nunemaker <
    ***@tenderapp.com> wrote:

  6. 7 Posted by John Nunemaker on 06 Jul, 2011 10:33 PM

    John Nunemaker's Avatar

    I would have thought blank? and empty? would work, but I tried and they did not appear to. The size > 0 definitely does.

  7. Support Staff 8 Posted by Steve Smith on 07 Jul, 2011 12:36 AM

    Steve Smith's Avatar

    thing.blank? and thing.empty do not work in liquid, but thing == blank and thing == empty will.

  8. Jonathan Hoyt closed this discussion on 07 Oct, 2011 02:26 AM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

17 May, 2012 10:45 PM
20 Mar, 2012 05:05 PM
26 Apr, 2012 01:40 AM
07 Mar, 2012 04:42 PM