<commit_before>BecklynAssetsBundle
===================

High-performance asset handling for symfony projects.

This bundle is a simplified and specialized replacement for `symfony/asset`.


Installation
------------

```bash
composer require "becklyn/assets-bundle"
```

and then add the bundle in your `AppKernel` / `bundles.php`.

Load the routes (preferably only in `dev`):

```yaml
becklyn_assets:
    resource: "@BecklynAssetsBundle/Resources/config/routes.yaml"
    prefix: /_assets/
```


Info / Purpose
--------------

This bundle aims to provide a way to transparently handle long-term caching of assets.

All assets in your entry points are copied (and possibly transformed) to `public/assets/` and the file names modified, so that they contain the content hash of the given file.
It also provides Twig functions to use these translated paths transparently in a symfony application.

In Twig the original filename is given to the `asset*` function and it automatically generates the HTML reference for the hashed file name.

**Warning:** the directory `public/assets/` is completely cleared on cache clear, so it should exclusively be managed by this bundle.<commit_msg>Add README section about installing zopfli<commit_after>BecklynAssetsBundle
===================

High-performance asset handling for symfony projects.

This bundle is a simplified and specialized replacement for `symfony/asset`.


Installation
------------

```bash
composer require "becklyn/assets-bundle"
```

and then add the bundle in your `AppKernel` / `bundles.php`.

Load the routes (preferably only in `dev`):

```yaml
becklyn_assets:
    resource: "@BecklynAssetsBundle/Resources/config/routes.yaml"
    prefix: /_assets/
```

To use the static compression of assets, install `zopfli` or `gzip`.

```bash
apt install zopfli
# or
brew install zopfli
```


Info / Purpose
--------------

This bundle aims to provide a way to transparently handle long-term caching of assets.

All assets in your entry points are copied (and possibly transformed) to `public/assets/` and the file names modified, so that they contain the content hash of the given file.
It also provides Twig functions to use these translated paths transparently in a symfony application.

In Twig the original filename is given to the `asset*` function and it automatically generates the HTML reference for the hashed file name.

**Warning:** the directory `public/assets/` is completely cleared on cache clear, so it should exclusively be managed by this bundle.
{'fraction_non_alphanumeric': 0.10135135135135136, 'fraction_numerical': 0.0, 'mean_word_length': 4.221991701244813, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2384256', 'n_tokens_mistral': 666, 'n_tokens_neox': 629, 'n_words': 315}