markocupic / contao-news-infinite-scroll-bundle

Contao 4 module: Add Infinite Scroll to the Contao Newslist Module
4 stars 1 forks source link

Fix caching (and improve other things) #11

Closed fritzmg closed 2 years ago

fritzmg commented 2 years ago

If you enable the HTTP cache in your contao installation, issues might occur with the infinite scroll module. For example, if a non-AJAX request is made to a pagination URL (e.g. by a crawler), then that URL will be cached. However, this will cause the AJAX functionality to break, because then the cached response includes the full page and not just the news elements.

Furthermore if you have two newslists on the same page, only the first one will really work.

This PR fixes that and improves some other things as well:

Since this PR changes many little things at once, I can also split it up into different PRs, if you want.

markocupic commented 2 years ago

Hi Fritz Thank you for the further development! This is cool! Marko

markocupic commented 2 years ago

@fritzmg Should we change the minor version, too?

fritzmg commented 2 years ago

@fritzmg Should we change the minor version, too?

Up to you, I think it can be considered a bugfix but also a new feature to support caching in a more proper way.