Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Balesh 28 posts 49 karma points
    Apr 18, 2012 @ 09:34
    Balesh
    0

    Invalidate cache whenever content is updated

    Hi All,

    We are using micro caching for our website (for 24 hours). We want that whenever user publishes new content, cache should get invalidated. To acheive that we have writtern following trigger.

    [Task("987F101F-D06F-48EB-A40B-8E6407276237", TaskTriggers.Hive.PostAddOrUpdateOnUnitComplete, ContinueOnFailure = false)]

    public class DocumentPublishedTask : AbstractWebTask

    {

        public DocumentPublishedTask(IUmbracoApplicationContext applicationContext)

            : base(applicationContext)

        {

        }

     

        public override void Execute(TaskExecutionContext context)

        {

            HttpRuntime.UnloadAppDomain();

        }

     

        protected virtual void OperateOnPostAction(HiveEntityPostActionEventArgs eventArgs)

        {

            HttpRuntime.UnloadAppDomain();

        }

    }

    But this trigger is not firing. My questions are:

    1. Do we need to do something extra to make this work?

    2. We are planning to write a crawler service (scheduler) which we hit our web pages in interval of 10-20 min. so that our pages stay in cache. Is there any better approach to acheive this?

    Thanks In Advance

     Balesh Kumar

     

  • Balesh 28 posts 49 karma points
    Apr 18, 2012 @ 13:44
    Balesh
    0

    Anyone, please help. We are blocked on thi issue

  • Grant Thomas 291 posts 324 karma points
    Apr 18, 2012 @ 14:09
    Grant Thomas
    0

    Please state the version of your Umbraco instance.

  • Balesh 28 posts 49 karma points
    Apr 18, 2012 @ 14:10
    Balesh
    0

    Thanks for reply Grant. We are using Version 5.0.1.

    Balesh

  • Grant Thomas 291 posts 324 karma points
    Apr 18, 2012 @ 15:16
    Grant Thomas
    0

    Hm, so a very recent version. And it should be noted that this is a bug in Umbraco, not something you should have to worry about (but we do); without giving a direct answer, what I will say is this. If you can hold out then this should be fixed (hopefully, since it should be fairly straightforward for the devs (I think)) really soon, meaning you can just push your deployment with an upgrade.

    It might be a bit much to go to all this bother only to see it fixed next week. But I understand if you're in a fix and need it done, like, yesterday.

  • Balesh 28 posts 49 karma points
    Apr 19, 2012 @ 16:52
    Balesh
    0

    Thanks Grant,

    I hope Umbraco developer has noticed this. If not, please do that.

     

    Thanks

    Balesh Kumar

Please Sign in or register to post replies

Write your reply to:

Draft