internal static IPageFactory GetPageFactory(Localization localization)
        {
            lock (_pageFactories)
            {
                IPageFactory pageFactory;
                if (!_pageFactories.TryGetValue(localization.LocalizationId, out pageFactory))
                {
                    pageFactory = new PageFactory
                    {
                        PublicationResolver = new PublicationResolver(localization),
                        LinkFactory = new ExtensionlessLinkFactory()
                    };
                    _pageFactories.Add(localization.LocalizationId, pageFactory);
                }

                return pageFactory;
            }
        }
        internal static IPageFactory GetPageFactory(Localization localization)
        {
            lock (_pageFactories)
            {
                IPageFactory pageFactory;
                if (!_pageFactories.TryGetValue(localization.LocalizationId, out pageFactory))
                {
                    IPublicationResolver publicationResolver = new PublicationResolver(localization);
                    IProvidersCommonServices providersCommonServices = new ProvidersCommonServices(publicationResolver, _logger, _config);
                    IFactoryCommonServices factoryCommonServices = new FactoryCommonServices(publicationResolver, _logger, _config, CreateCacheAgent());
                    pageFactory = new PageFactory(
                        new TridionPageProvider(providersCommonServices), 
                        GetComponentPresentationFactory(localization), 
                        factoryCommonServices
                        ); 
                    _pageFactories.Add(localization.LocalizationId, pageFactory);
                }

                return pageFactory;
            }
        }