

Add config.action_view.image_loading
source link: https://github.com/rails/rails/pull/38452
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Browser native support for lazy loading images is now a part of the official HTML standard. To indicate to the browser that an image should be lazily loaded, add the loading="lazy"
attribute to the img
tag. Or, in Rails parlance, add the loading: "lazy"
option to the image_tag
call.
This commit adds Rails.application.config.action_view.image_loading
to configure the default value of the image_tag
:loading
option. Thus by setting config.action_view.image_loading = "lazy"
, an application can opt in to lazy loading images sitewide, without changing view code.
Currently only Chrome and Edge support loading="lazy"
(reference), but Firefox 75 will support it, and Safari will soon.
TODO
- documentation
- additional tests for the Railtie code
Recommend
-
77
-
19
New issue Add config.action_view.image_decoding #40839
-
8
Rails 6.1 adds config option to control image_tag loading attribute Mar 1, 2021 , by Swaathi Kakarla 1 minute read Page loa...
-
26
In this article, we’ll learn how to add a simple loading spinner in Angular using RxJS and then use an HttpInterceptor to automatically show a loader on all network calls in our Angular app. Why a loading spinner? But fi...
-
6
HTML5 loading a section & lt; & Gt; contained in a main view envelope? advertisements I am no stranger to front-end development, but I...
-
9
Add infinite loading to your Nuxt project in 10 minutes! Are you tired of using pagination on your site or application? Is it really the best design approach for the end user of your page or application? There is an al...
-
5
Add SCSS config for old React project.漂洋过海来看你IT俱乐部-码出人生Add SCSS config for old React project.Jan 25, 2022
-
7
Add Lazy Loading in Your Website for Better Website Performance 979 views 5 months ago Javascript Lazy loading i...
-
6
Windows 11 build 25182 has a hidden config allowing faster taskbar loading...
-
9
While working on a very large iOS client project, I was investigating the causes for our slow app launch time. We had a hypothesis that part of the problem was that too many view controllers were getting loaded in memory, in particular, o...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK