Skip to content

Remove Laravel optimize:clear from startup - #559

Open
radiantjade wants to merge 1 commit into
railwayapp:mainfrom
radiantjade:remove-laravel-optimize-clear
Open

Remove Laravel optimize:clear from startup#559
radiantjade wants to merge 1 commit into
railwayapp:mainfrom
radiantjade:remove-laravel-optimize-clear

Conversation

@radiantjade

Copy link
Copy Markdown
Contributor

Fixes #555.

This removes php artisan optimize:clear from the Laravel container startup script while keeping storage:link and optimize. Running optimize:clear on every start can flush Laravel's default cache store during deploys and restarts; startup should warm optimization caches without clearing runtime cache first.

Verification:

  • go test ./core/providers/php
  • go test ./core -run 'TestGenerateBuildPlanForExamples/php-laravel'\n- go test ./core -run 'TestGenerateBuildPlanForExamples/php-vanilla'\n- git diff --check\n\nNote: go test ./core currently fails on unrelated Node/staticfile snapshots because generated Caddy commands now resolve caddy@2.11.3 while existing snapshots expect caddy@2.11.2. The PHP-focused tests above pass.

Railpack should warm Laravel optimization caches without running optimize:clear on every container start. The clear command can flush the default app cache store, which is surprising during deploys and restarts.

Constraint: Laravel startup still needs storage link and optimize warmup behavior.

Rejected: Keep optimize:clear before optimize | can clear production runtime cache.

Confidence: medium

Scope-risk: narrow

Tested: go test ./core/providers/php

Tested: go test ./core -run 'TestGenerateBuildPlanForExamples/php-laravel'

Tested: go test ./core -run 'TestGenerateBuildPlanForExamples/php-vanilla'

Not-tested: go test ./core currently has unrelated Caddy snapshot drift from caddy@2.11.2 to caddy@2.11.3 in Node/staticfile examples.

@iloveitaly iloveitaly left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks like a great change. If you can fix CI failures I'm happy to merge this in!

@iloveitaly

Copy link
Copy Markdown
Collaborator

Friendly ping here! I'm making some improvements to the PHP support here soon, so would love to get this change in.

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.

Remove optimize:clear from Laravel container startup

2 participants