Ben W

Rebuild blog as background task or CRON - with custom fields?

Vote 0 Votes

Okay, now I've got my blog to finally allow comments, but as with it is with MT; on new/changed comments only indexes are rebuilt. That's not ideal, as I have a recent comments sidebar entry which needs to be rebuilt on all pages.

I wouldn't mind this with a delay, e.g. called by periodic-cron-tasks, or however this could be done.

I stumbled upon two "rebuild all" scripts, which would work, only if I wasn't the Commercial Pack for custom fields. So guess what, if I try to use those rebuild scripts, they won't execute as they find "illegal" tags I created with custom fields.

Does anyone a solution for that? It's driving me nuts for some hours now :)

Thank you so much in advance!

- Ben

Reported on Movable Type 5

6 Replies

| Add a Reply
  • Good ol' "tool/rebuild-pages" does the job. Making a CRON job from it.

  • Hi Ben,

    Have you tried the mt-rebuild.pl plugin?

    That should be able to do the trick for you.

    Alternatively you could use php or ssi includes for that widget which is used across all the pages, so that it would update itself once when a new comment is posted and then appear instantly site-wide, without the need to rebuild.

    Kind Regards,
    Mihai Bocsaru

    ----------------------------------
    Web Development
    Movable Type Consulting
    Six Apart Partner

    http://www.pro-it-service.com/
    ----------------------------------

    Movable Type Demo
    http://www.movabletypedemo.org/

  • Hey Mihai,

    thanks for your answer. Indeed, mt-rebuild.pl is one of the two plugins that can't deal with custom fields. But that's not too bad, as tools/rebuild-pages still does its job, reliably, even as a CRON job.

    I thought about SSI or an PHP include as well, but that's not viable in a Varnish setup. I currently evaluate ESI (https://www.varnish-cache.org/trac/wiki/ESIfeatures) for that very special purpose. I'll let you know how that works out :)

    Yours,
    - Ben

  • Alright Ben, though it is strange to hear that the mt-rebuild one cannot handle custom fields.

    Kind Regards,
    Mihai Bocsaru

  • This probably could be solved. When I tried this very plugin, I had duplicate "ghost templates" of some of my index pages but defined as entrys in my DB (showed up nowhere in the backend). I suppose it could be due to that when I used the CLI tool I got an " is not a valid template tag" (replaced with an actual tag I use, not this one). Nevertheless, as I just test ESI, I might "get rid" of forced rebuilds just in favor of periodic cron tasks.

    Thanks for the head up!

  • ESI works great, just make sure that - unless you're using Varnish 3 - your backend doesn't send gzipped/deflated files. MT is like make for Varnish. Or vice versa, of course ;-)

Add a Reply

If you need to share template code, replace all the "<" signs with "&lt;" or use this utility.

Forum Groups

1774 6167

Last Topic: Template modules by Zielun on Feb 16, 2012

86 302

Last Topic: website entries by masoud on Oct 26, 2011

1434 5088

Last Topic: Maintenance announcement by Nick on Feb 17, 2012

695 2912

Last Topic: Insert Image / File Fails by Russ Miller on Feb 10, 2012

84 291

Last Topic: How to have some other characters in entry basename automatically written by Afshin Haghighatnia on Dec 22, 2011

174 740

Last Topic: Captcha images rendering slowly by ScottM on Feb 12, 2012

190 568

Last Topic: Analytics Reporting by michael webster on Feb 5, 2012

48 210

Last Topic: An idea and also a request by Afshin Haghighatnia on Jun 29, 2011

64 246

Last Topic: jQuery in MT 5.1 still at 1.4 - why? by perlmonkey on May 25, 2011

code.sixapart.com

137 478

Last Topic: Getting a thumbnail with xpath by Peter on Mar 13, 2011

222 720

Last Topic: Custom Field for Asset Not Appearing by android on Feb 9, 2012