Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 264849
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:43:12+00:00 2026-05-11T22:43:12+00:00

We have a staged environment with 1 CMS and 3 Slave servers I want

  • 0

We have a staged environment with 1 CMS and 3 Slave servers

I want to create a page on the slave server, which will be called by the staging module on a successful publish, that will rebuild all indexes and the links database.

I know I can use:

Globals.LinkDatabase.Rebuild(Factory.GetDatabase("web"));

to rebuild the link database.

How do I get the above code in a separate process that has access to the sitecore context and also how do I rebuild all the indexes for the web database – again in a separate background thread.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:43:12+00:00Added an answer on May 11, 2026 at 10:43 pm

    I’ve come across this issue before with Sitecore and took a slightly different approch. Instead of having a page that the staging module calls I tapped into the publish:end event and added a custom handler to rebuild the Link Database.

    <event name="publish:end">
        <handler type="Sitecore.Publishing.HtmlCacheClearer, Sitecore.Kernel" method="ClearCache">
            <sites hint="list">
                <site>website</site>
            </sites>
        </handler>
        <handler type="Sitecore.EventHandlers.CredentialCacheClearer, Sitecore.EventHandlers" method="ClearCache">
            <sites hint="list">
                <site>website</site>
            </sites>
        </handler>
    
        // Custom Publish Action Below
        <handler type="Customized.Publish.LinkDatabase, Customized" method="Process"/>
    </event>
    
    namespace Customized.Publish
    {
        public class LinkDatabase
        {
            /// <summary>
            /// Rebuild the web link database.
            /// </summary>
    
            public void Process()
            {
                // Web db
                Sitecore.Globals.LinkDatabase.Rebuild(Sitecore.Configuration.Factory.GetDatabase("web"));
            }
    
            /// <summary>
            /// For invoking as an event, typically publish:end.
            /// </summary>
            public void Process(object sender, EventArgs args)
            {
                this.Process();
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a textField on my stage named 'adBuy', which when clicked I want
I have a Sinatra::Base webservice which I want to start from a command line
I have a web-service that I will be deploying to dev, staging and production.
I want to create a development environment with my central repository hosted somewhere like
I have a web application that works in our stage/test environment fine but once
I've encountered posts which have stated, I'd love to use Extension A but it
I have a development environment set up in Windows using WAMP. The production environment
I am working in an Agile environment and things have gone to the state
We have an ASMX web service which we invoke from our ASP.NET application using
I already have a production instance deployed on the server. Its working well. Here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.