Skip to content

Commit

Permalink
Merge pull request #9995 from creative-commoners/pulls/4/lazy-load-docs
Browse files Browse the repository at this point in the history
Add docs for lazy loading
  • Loading branch information
emteknetnz committed Jul 8, 2021
2 parents f6e8d6e + 03b4322 commit 4366782
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions docs/en/02_Developer_Guides/14_Files/02_Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,19 @@ SilverStripe\Core\Injector\Injector:
Quality: 90
```

### Lazy Loading

Images added via the WYSIWYG editor and as objects on templates are [lazy loaded](https://developer.mozilla.org/en-US/docs/Web/Performance/Lazy_loading) by default.

To disable lazy loading for an individual image with a template, you can call `$MyImage.LazyLoad(false)`.

You can opt out of lazy loading globally by setting the `Image::lazy_loading_enabled` config to `false`, see example `yml`:

```yml
SilverStripe\Assets\Image:
lazy_loading_enabled: false
```

## Changing the manipulation driver to Imagick

If you want to change the image manipulation driver to use Imagick instead of GD, you'll need to change your config so
Expand Down

0 comments on commit 4366782

Please sign in to comment.