Lib cache to aggressive when lib files are missing #633

Closed
hanikesn opened this Issue Aug 25, 2013 · 8 comments

Comments

Projects
None yet
4 participants
@hanikesn
Contributor

hanikesn commented Aug 25, 2013

I was messing around with the plugins and enabled mod_admin and mod_admin_catgeory. mod_admin_catgeory references zp-menuedit.css. But zp-menuedit.css is provided by mod_menu. Therefore it was missing from the css lib request. After enabling mod_menu, the file was still missing from the response. Restarting zotonic fixed that.

@mworrell

This comment has been minimized.

Show comment Hide comment
@mworrell

mworrell Aug 26, 2013

Owner

I think the "Not Found" condition was cached a bit too aggressively. This cache should be cleared whenever a new module is enabled.

Will check if the correct dependency is set for the not-found cache.

Owner

mworrell commented Aug 26, 2013

I think the "Not Found" condition was cached a bit too aggressively. This cache should be cleared whenever a new module is enabled.

Will check if the correct dependency is set for the not-found cache.

mworrell referenced this issue Aug 26, 2013

core: after modules are re-indexed also flush the 'module_index' depe…
…ndency key. Let cached lib file paths depend on that key. Fixes #663

@mworrell mworrell closed this Aug 26, 2013

@mworrell

This comment has been minimized.

Show comment Hide comment
@mworrell

mworrell Aug 26, 2013

Owner

@hanikesn Steffen, thanks for your report. I think my commit will fix this issue by adding an extra dependency check for the cached lib lookups. When possible, please give this version a try with your setup.

BTW, instead of restarting you could also flush the cache (see /admin/status or use z:flush() from the Erlang command line)

Owner

mworrell commented Aug 26, 2013

@hanikesn Steffen, thanks for your report. I think my commit will fix this issue by adding an extra dependency check for the cached lib lookups. When possible, please give this version a try with your setup.

BTW, instead of restarting you could also flush the cache (see /admin/status or use z:flush() from the Erlang command line)

@hanikesn

This comment has been minimized.

Show comment Hide comment
@hanikesn

hanikesn Aug 26, 2013

Contributor

It works after doing a forced refresh from the browser now.

Contributor

hanikesn commented Aug 26, 2013

It works after doing a forced refresh from the browser now.

@hanikesn

This comment has been minimized.

Show comment Hide comment
@hanikesn

hanikesn Sep 3, 2013

Contributor

This doesn't seem to be resolved completely. You have to force refresh the browser or the browser will still cache the old response. I guess the generated link from the lib tag has to be changed, too.

Contributor

hanikesn commented Sep 3, 2013

This doesn't seem to be resolved completely. You have to force refresh the browser or the browser will still cache the old response. I guess the generated link from the lib tag has to be changed, too.

@kaos

This comment has been minimized.

Show comment Hide comment
@kaos

kaos Sep 4, 2013

Owner

Ah, I think I have an idea what you're getting at. The generated lib link has the timestamp of the newest file appended to it, so when any of the files are changed, it results in a new link.
But in this case, the missing file probably was older than at least one of the other files, thus not affecting the link.

One way around it, I suppose, would be to also append a count of files actually found in the link itself, that way it would capture when missing files turn up.

Could look like this:

http://zotonic.com/lib/js/apps/zotonic-1.0~z.widgetmanager~/js/modules/livevalidation-1.3~z.inputoverlay~4~63541218772.js

Say that zotonic couldn't find z.inputoverlay, the generated link would be:
http://zotonic.com/lib/js/apps/zotonic-1.0~z.widgetmanager~/js/modules/livevalidation-1.3~z.inputoverlay~3~63541218772.js

Owner

kaos commented Sep 4, 2013

Ah, I think I have an idea what you're getting at. The generated lib link has the timestamp of the newest file appended to it, so when any of the files are changed, it results in a new link.
But in this case, the missing file probably was older than at least one of the other files, thus not affecting the link.

One way around it, I suppose, would be to also append a count of files actually found in the link itself, that way it would capture when missing files turn up.

Could look like this:

http://zotonic.com/lib/js/apps/zotonic-1.0~z.widgetmanager~/js/modules/livevalidation-1.3~z.inputoverlay~4~63541218772.js

Say that zotonic couldn't find z.inputoverlay, the generated link would be:
http://zotonic.com/lib/js/apps/zotonic-1.0~z.widgetmanager~/js/modules/livevalidation-1.3~z.inputoverlay~3~63541218772.js

@kaos kaos reopened this Sep 4, 2013

@hanikesn

This comment has been minimized.

Show comment Hide comment
@hanikesn

hanikesn Sep 4, 2013

Contributor

This could not work, if one files is new and another is removed. ;) Why doesn't the generated lib link only include all available files. Or shouldn't it actually be an error if it can't find all files.

Right now mod_admin_category depends on mod_menu, braucht of the z.menuedit.js file. But I guess that's another bug.

Contributor

hanikesn commented Sep 4, 2013

This could not work, if one files is new and another is removed. ;) Why doesn't the generated lib link only include all available files. Or shouldn't it actually be an error if it can't find all files.

Right now mod_admin_category depends on mod_menu, braucht of the z.menuedit.js file. But I guess that's another bug.

@mworrell

This comment has been minimized.

Show comment Hide comment
@mworrell

mworrell Sep 4, 2013

Owner

Maybe the timestamp should be replaced with a checksum of all timestamps. Right now it is just the max of all timestamps. I agree that we might want to exclude the not-found library files from the url.

Owner

mworrell commented Sep 4, 2013

Maybe the timestamp should be replaced with a checksum of all timestamps. Right now it is just the max of all timestamps. I agree that we might want to exclude the not-found library files from the url.

@kaos

This comment has been minimized.

Show comment Hide comment
@kaos

kaos Sep 4, 2013

Owner

+1 for checksum of timestamps, that would solve it nicely.

Owner

kaos commented Sep 4, 2013

+1 for checksum of timestamps, that would solve it nicely.

@arjan arjan modified the milestones: Release 0.11, Release 0.10 Apr 17, 2014

@mmzeeman mmzeeman closed this in febd451 Apr 19, 2014

mmzeeman added a commit to mmzeeman/zotonic that referenced this issue Apr 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment