CatalogueNavigationCache

uk.gov.hmrc.cataloguewrapper.services.CatalogueNavigationCache
@Singleton
class CatalogueNavigationCache(connector: CatalogueMenuConnector, searchIndex: SearchIndex, config: CatalogueWrapperConfig)(implicit ec: ExecutionContext) extends Logging

Attributes

Graph
Supertypes
trait Logging
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def cachedMenu: Option[BannerMenu]
def refreshOrCached()(implicit hc: HeaderCarrier): Future[NavigationData]
def shouldRefreshForSearch(): Boolean

Returns true when the controller should attempt a backend refresh before serving a quicksearch result.

Returns true when the controller should attempt a backend refresh before serving a quicksearch result.

False (no refresh needed) when:

  • The cache was loaded from the backend and contains a non-empty search index.

True (refresh allowed) when:

  • The cache is empty (cold pod).
  • The cache holds fallback/empty-search data and the throttle interval has elapsed since the last refresh attempt.

Attributes

def shouldRefreshForSearch(now: Instant): Boolean

Inherited fields

protected val logger: Logger

Attributes

Inherited from:
Logging