Skip to content

Conversation

@fahlisaputra
Copy link
Owner

@fahlisaputra fahlisaputra commented Feb 24, 2025

This PR introduces a caching mechanism for asset minification, allowing the system to store and reuse minified files without reprocessing unchanged assets.

Changes Made

  • Stores minified asset paths in a cache file (storage/framework/cache/minify.php).
  • Checks if the minified file exists and is up-to-date before regenerating it.
  • Serves the cached minified file when available or falls back to the minify.assets route if not.
  • Throws an exception when the original asset file is not found.

Benefits

  • Improved Performance: Reduces redundant processing for unchanged assets.
  • Lower Server Load: Avoids unnecessary minification operations.

The cached file will be served with random string file name after minification.

@fahlisaputra
Copy link
Owner Author

fahlisaputra commented Feb 28, 2025

I'm not ready to merge this PR into the main branch yet, as there may still be potential bugs or errors. However, based on my tests in the local project, it has been running very well.

If you want to use this feature right now, please install from dev-feature/caching version from Packagist.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request help wanted Extra attention is needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache for minified files Implement caching to improve speed

3 participants