Prevent loading unnecessary content based on screen size

I am creating a responsive website where I have a news section. This section contains 2, 3 or 4 news items, depending on the screen size of visitors. So far, cms (modx) always provides 4 news, and if the user should have a small viewport, I hide additional news with the media.

It doesn't seem very efficient (it uses extra bandwidth for people with small screens). Also, using the approach described above, I ran into problems with “new messages”, navigation with “older messages” (because pressing “older messages” will always load 4 senior posts, while some people may need only 2 or 3 )

Is there a better, reliable way to do this? Is it possible to respond more effectively to news reports? In other words: how can I prevent the loading of unnecessary content based on screen size?

+5
source share
1 answer

, : , , ( 4, )

, JS, ajax (, " ..." ).

, 1 , JS ( , , JS, " " )

+3

All Articles