Skip to content

Add Octane support#113

Merged
ganyicz merged 3 commits intomainfrom
filip/octane
Mar 5, 2026
Merged

Add Octane support#113
ganyicz merged 3 commits intomainfrom
filip/octane

Conversation

@ganyicz
Copy link
Collaborator

@ganyicz ganyicz commented Mar 5, 2026

The scenario

Using Blaze with Laravel Octane. State from one request leaks into subsequent requests, causing errors.

The problem

Blaze's core singletons (BlazeRuntime, BlazeManager, Debugger, Memo, Unblaze) accumulate per-request state that is never reset between Octane requests.

The solution

  • Added flushState() methods to all stateful classes and registered RequestReceived listener that resets them between requests:
  • Added setApplication() on BlazeRuntime so Octane can swap in its sandbox app instance.
  • Moved debug timer injection from the middleware into the view composer.

Fixes #85
Fixes #109

@github-actions
Copy link
Contributor

github-actions bot commented Mar 5, 2026

Benchmark Results

Attempt Blade Blaze Improvement
#1 * 353.12ms 19.29ms 94.5%
#2 * 358.79ms 20.06ms 94.4%
#3 359.17ms 19.81ms 94.5%
#4 349.04ms 19.72ms 94.4%
#5 349.66ms 19.79ms 94.3%
#6 352.43ms 19.65ms 94.4%
#7 348.99ms 19.69ms 94.4%
#8 348.58ms 19.70ms 94.3%
#9 352.15ms 19.63ms 94.4%
#10 356.77ms 19.54ms 94.5%
Snapshot 379.47ms 19.66ms 94.8%
Result 350.91ms (-7.5%) 19.70ms (~) 94.4% (-0.4%)

Median of 10 attempts (* = outlier, excluded from result), 5000 iterations x 10 rounds, 46.93s total

@ganyicz ganyicz merged commit 8a96b57 into main Mar 5, 2026
4 checks passed
@ganyicz ganyicz deleted the filip/octane branch March 5, 2026 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

view:cache does not compile Blaze component function files, causing ViewException on Octane deployments Laravel Octane isn't supported

1 participant