Skip to content

Commit

Permalink
Clarify AS::Representations::RedirectController processes files [skip…
Browse files Browse the repository at this point in the history
… ci]

Co-authored-by: zzak <zzakscott@gmail.com>
  • Loading branch information
shouichi and zzak committed Mar 3, 2023
1 parent 6359aea commit f67398f
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions guides/source/active_storage_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -826,10 +826,15 @@ image_tag file.representation(resize_to_limit: [100, 100])

Will generate an `<img>` tag with the `src` pointing to the
[`ActiveStorage::Representations::RedirectController`][]. The browser will
make a request to that controller, which will return a `302` redirect to the
file on the remote service (or in [proxy mode](#proxy-mode), return the file
contents). Loading the file lazily allows features like
[single use URLs](#public-access) to work without slowing down your initial page loads.
make a request to that controller, which will perform the following:

1. Process file and upload the processed file if necessary.
2. Return a `302` redirect to the file either to
* the remote service (e.g., S3).
* or `ActiveStorage::Blobs::ProxyController` which will return the file contents if [proxy mode](#proxy-mode) is enabled.

Loading the file lazily allows features like [single use URLs](#public-access)
to work without slowing down your initial page loads.

This works fine for most cases.

Expand Down

0 comments on commit f67398f

Please sign in to comment.