CMS Development

likwid
Participant

lazy laoding blog images

SOLVE

I have tried a couple different js solutions to lazy load images. I can get it to work on some pages but not others. It doesn't seem to work here:

 

https://start.docuware.com/blog/document-management

 

I can tell because if I do an audit it still asks me to defer images off the page.

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fstart.docuware.com%2Fblog%...

 

But if I run it on this page they don't show up.

https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fstart.docuware.com%2Fblog%...

 

Any ideas?

 

0 Upvotes
1 Accepted solution
dbeau79
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

lazy laoding blog images

SOLVE

@likwid , I took a quick look at your blog source code and it looks like you are loading your blog content twice in the template.  The first instance (which you see) is properly lazy loading the images but the second is not.  Have a look at your template and see if you can find a second instance of the {% for content in contents %} loop.  I'm 99% certain you can just remove it.  

View solution in original post

2 Replies 2
dbeau79
Solution
Contributor | Diamond Partner
Contributor | Diamond Partner

lazy laoding blog images

SOLVE

@likwid , I took a quick look at your blog source code and it looks like you are loading your blog content twice in the template.  The first instance (which you see) is properly lazy loading the images but the second is not.  Have a look at your template and see if you can find a second instance of the {% for content in contents %} loop.  I'm 99% certain you can just remove it.  

likwid
Participant

lazy laoding blog images

SOLVE

Hi dbeau79,

Thank you for taking a look. That was the problem. No idea why the code is in there twice. Gotta love legeacy code. Thanks

again for your help.

0 Upvotes