collective / collective.lazysizes

Integration of lazysizes, a lightweight lazy loader, into Plone.
https://pypi.org/project/collective.lazysizes
6 stars 2 forks source link

Problem with cache #69

Closed idgserpro closed 6 years ago

idgserpro commented 6 years ago

I added the collective.lazysizes in the eggs of a portal that has cache (Varnish).

When I accessed the portal before installing the product, Plone couldn't find the file ++resource ++collective.lazysizes /lazysizes-43c36fc.js, because the resources directory is only available after installation.

This is because the viewlet that attempts to access the js is available before the product is installed.

At this point, Varnish places the js in cache forever as not found. Since the file isn't in the portal_javascript, even after installing the product, Varnish continues to return the file as not found.

erral commented 6 years ago

The solution will be to add the "layer" parameter in the ZCML registration here:

https://github.com/collective/collective.lazysizes/blob/43c36fc493a3731bce47da5efff02e2b2cce49dc/src/collective/lazysizes/browser/configure.zcml#L12

idgserpro commented 6 years ago

@hvelarde @rodfersou

Please ensure that this problem doesn't occur in other packages that use webpack.

hvelarde commented 6 years ago

@idgserpro we're doing the best we can; I would appreciate code reviews instead of complaints.

hvelarde commented 6 years ago

@idgserpro I have released https://pypi.org/project/collective.lazysizes/4.1.2/ that should fix the issue.