/
[deployment] Warm cache during deployment [5.3.0-B1]

[deployment] Warm cache during deployment [5.3.0-B1]

The deployment process of In-Portal looks like this:

  1. update code (usually from VCS)
  2. execute database migrations (implemented via In-Portal itself)
  3. mark caches as stale (implemented via In-Portal itself)
  4. install latest dependencies (via Composer)

The problem with current approach is that cache is only marked as stale, but isn't rebuilt immediately and next website visitor can see a delay in page loading that happens right after deploy.

Solution

  1. add "RelativeCacheWarmupUrls" system setting (textarea); format: one URL per line format
  2. when user tries to change "RelativeCacheWarmupUrls" system setting value, then:
    1. validate each line to be a relative URL
    2. validate each line to be an existing page on this website (just CURL in there and see that 2x response is shown)
  3. during deployment process (the "adm:OnDeploy" event) make a CURL requests to each of URLs specified above to warm up the cache

Related Tasks