| 1 |
<?php |
| 2 |
|
| 3 |
if (!defined('ABSPATH')) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
/** |
| 8 |
* Runtime-only flags and cache constants for the admin view-read path. |
| 9 |
*/ |
| 10 |
final class ABJ_404_Solution_ViewReadRuntimeState { |
| 11 |
|
| 12 |
const CACHE_KEY_REDIRECT_STATUS = 'abj404_redirect_status_counts'; |
| 13 |
const CACHE_KEY_CAPTURED_STATUS = 'abj404_captured_status_counts'; |
| 14 |
const CACHE_KEY_HIGH_IMPACT_CAPTURED = 'abj404_high_impact_captured'; |
| 15 |
const STATUS_CACHE_TTL = 86400; |
| 16 |
const STATUS_CACHE_TIMEOUT_SELFHEAL_TTL = 300; |
| 17 |
const VIEW_SNAPSHOT_CACHE_TTL_SECONDS = 120; |
| 18 |
const VIEW_SNAPSHOT_REFRESH_COOLDOWN_SECONDS = 30; |
| 19 |
const VIEW_SNAPSHOT_WARMUP_STAGE_TIMEOUT_SECONDS = 28; |
| 20 |
const VIEW_SNAPSHOT_WARMUP_STALE_SECONDS = 35; |
| 21 |
const VIEW_SNAPSHOT_WARMUP_MAX_ATTEMPTS = 3; |
| 22 |
const VIEW_SNAPSHOT_MAX_PAYLOAD_BYTES = 2097152; |
| 23 |
const LOGS_COUNT_CACHE_TTL_SECONDS = 60; |
| 24 |
|
| 25 |
/** |
| 26 |
* Debounce window for the high-frequency captured-insert path. A busy 404 |
| 27 |
* site captures continuously; invalidating the captured status-count cache |
| 28 |
* on every insert keeps the SUM(CASE) aggregate permanently cold (report.md |
| 29 |
* Finding 4). A captured insert clears the captured cache at most once per |
| 30 |
* this window; the count is therefore at most this many seconds stale. |
| 31 |
* Matched to the view-snapshot refresh cooldown / client detect-poll cadence. |
| 32 |
*/ |
| 33 |
const CACHE_KEY_CAPTURED_COUNT_INVALIDATE_COOLDOWN = 'abj404_captured_count_invalidate_cooldown'; |
| 34 |
const CAPTURED_COUNT_INVALIDATE_COOLDOWN_SECONDS = 30; |
| 35 |
|
| 36 |
/** @var bool Per-request bulk mutation deferral flag. */ |
| 37 |
public static $bulkMutationInProgress = false; |
| 38 |
} |
| 39 |
|