MinnPost / minnpost-wordpress

MinnPost.com in WordPress
GNU General Public License v2.0
2 stars 0 forks source link

Lazy load #72

Closed jonathanstegall closed 4 years ago

jonathanstegall commented 6 years ago

We need a new way to do lazy loading of images. The Easy Lazy Loader caused the database to crash. It overloaded the server with these queries:

SELECT post_id FROM wp_postmeta WHERE meta_value='https://www.minnpost.com/sites/default/files/image
SELECT post_id FROM wp_postmeta WHERE meta_value='https://oasc17.247realmedia.com/RealMedia/ads/adst
jonathanstegall commented 5 years ago

It seems like the IntersectionObserver API is the way to go, with a polyfill, both because Google prefers it and because it seems to be an emerging standard.

jonathanstegall commented 5 years ago

Apparently the Financial Times does lazy loading using IntersectionObserver. They have some documentation about how they manage ads, but it's unclear how useful it would be for us.

Their ad framework (using DFP) is called oAds

jonathanstegall commented 5 years ago

I think we have a good solution for this now. The next step is to test it on dev/stage before the ad people decide when they'd like to enable it.

https://github.com/MinnPost/appnexus-acm-provider/releases/tag/0.0.19

jonathanstegall commented 5 years ago

Planning to do an initial test with this plugin for a full day of data on 11/17/18

jonathanstegall commented 5 years ago

Things that have been tested on the live server and appear to work as they should:

jonathanstegall commented 5 years ago

This is running for embed ads on the live server as of 1/8/19.

jonathanstegall commented 5 years ago

This is all running on the live server as of 3/4/19. We should watch and make sure nothing goes wrong for a bit.

jonathanstegall commented 4 years ago

I can't remember why this broke, but it was turned off for non-ads. I finally turned on the included-with-host Jetpack lazy load setting for images in general on 1/10/20. It seems to be working fine. Going to close this for now.