<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cache Functionality on Porch Documentation</title><link>/v1.5/docs/5_architecture_and_components/package-cache/functionality/</link><description>Recent content in Cache Functionality on Porch Documentation</description><generator>Hugo</generator><language>en-us</language><atom:link href="/v1.5/docs/5_architecture_and_components/package-cache/functionality/index.xml" rel="self" type="application/rss+xml"/><item><title>Repository Synchronization</title><link>/v1.5/docs/5_architecture_and_components/package-cache/functionality/repository-synchronization/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/v1.5/docs/5_architecture_and_components/package-cache/functionality/repository-synchronization/</guid><description>&lt;h2 id="overview">Overview&lt;/h2>&lt;p>The Package Cache synchronization system manages the synchronization of package repositories between external Git sources and the internal cache. Both cache implementations (CR Cache and DB Cache) utilize a common SyncManager to handle periodic and one-time synchronization operations.&lt;/p>
&lt;h3 id="high-level-architecture">High-Level Architecture&lt;/h3>&lt;p>&lt;img src="/v1.5/images/porch/repository-sync.svg" alt="Repository Sync Architecture" />&lt;/p>


&lt;a href="/v1.5/images/porch/repository-sync-interactive.html" target="_blank">📊 Interactive Architecture Diagram&lt;/a>

&lt;h2 id="core-components">Core Components&lt;/h2>&lt;h3 id="1-syncmanager">1. SyncManager&lt;/h3>&lt;p>&lt;strong>Purpose&lt;/strong>: Central orchestrator for repository synchronization operations.&lt;/p>
&lt;p>&lt;strong>Components&lt;/strong>:&lt;/p>
&lt;ul>
&lt;li>&lt;strong>Handler&lt;/strong>: Interface for cache-specific sync operations&lt;/li>
&lt;li>&lt;strong>Core Client&lt;/strong>: Kubernetes API client for cluster communication&lt;/li>
&lt;li>&lt;strong>Next Sync Time&lt;/strong>: Tracks when the next synchronization should occur&lt;/li>
&lt;li>&lt;strong>Last Sync Error&lt;/strong>: Records any errors from previous sync attempts&lt;/li>
&lt;/ul>
&lt;p>&lt;strong>Goroutines&lt;/strong>:&lt;/p></description></item><item><title>Caching Behavior</title><link>/v1.5/docs/5_architecture_and_components/package-cache/functionality/caching-behavior/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/v1.5/docs/5_architecture_and_components/package-cache/functionality/caching-behavior/</guid><description>&lt;h2 id="overview">Overview&lt;/h2>&lt;p>The Package Cache optimizes performance by storing repository data in memory (CR Cache) or database (DB Cache) to avoid redundant Git operations. The caching system uses lazy loading, version-based refresh, and concurrency control to balance performance with data freshness.&lt;/p>
&lt;h3 id="high-level-architecture">High-Level Architecture&lt;/h3>&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-fallback" data-lang="fallback">&lt;span class="line">&lt;span class="cl">┌─────────────────────────────────────────────────────────┐
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ Caching System │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ ┌──────────────┐ ┌──────────────┐ ┌──────┐ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ Cache │ │ Version │ │ Git │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ Population │ ───&amp;gt; │ Tracking │ ───&amp;gt; │ Repo │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ │ │ │ │ │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ • Lazy Load │ │ • Compare │ │ │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ • Refresh │ │ • Refresh │ │ │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ └──────────────┘ └──────────────┘ └──────┘ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ └──────────┬───────────┘ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ ↓ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ ┌──────────────────┐ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ Cache Structure │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ • Maps │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ • Mutex │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ │ • Consistency │ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">│ └──────────────────┘ │
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">└─────────────────────────────────────────────────────────┘
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="cache-population">Cache Population&lt;/h2>&lt;p>The cache uses lazy loading and version-based refresh to minimize Git operations:&lt;/p></description></item></channel></rss>