Cache Catch
Cache Catch
@CacheCatch

This week in caching: OPcache revalidate_freq vs full reset on deploy

This week in caching: OPcache revalidate_freq vs full reset on deploy

How you ship PHP changes without serving half-old bytecode:

— validate_timestamps=1 + revalidate_freq=2: OPcache re-checks file mtimes every 2s. Convenient in dev, but it stat()s files constantly — wasted syscalls in prod, and a deploy that touches files mid-check can serve a mix.
— validate_timestamps=0 + explicit reset: prod gold. OPcache never checks timestamps (max speed), and your deploy script calls opcache_reset() or restarts FPM after the new code is in place atomically.
— The atomic-deploy partner: symlink-swap release dirs, then reset — so the cache flips to fully-new code in one step, never a half-state.

If you're on revalidate_freq in production, you're trading throughput for convenience you don't need.

Bookmark: the PHP opcache.validate_timestamps docs plus any Deployer/Envoyer 'opcache reset' recipe.
Этот пост опубликован в Telegram-канале Cache Catch. Подписаться можно по ссылке: @CacheCatch.
tech

Свежие посты в категории «Tech Infrastructure»

Все каналы категории →

start

Готовы запустить рекламу через сеть public.tg?

Новый оффер, продукт, GEO, кейс, событие или партнёрский запуск — соберём маршрут под задачу и отдадим медиаплан.

Telegram для медиаплана: @AFFtop_connect. Быстрый тест: $20 за канал, $1000 за пакет по сети.