I have annotated the relevant changes, in the commit, to make it easier to review.
I am unsure of what I should do re:code formating, in the future... I use Emacs M-x untabify because some files in the master branch have tabs in them, but that also seem to change the indentation. So I used ocp-indent as @Engil suggested, but the resulting indentation is different too, adding a lot of noise to my commits.
hmm, the updated here is the Canopy startup time... but tags might be added later (by addng a new article, or new tags to an existing article). should we either drop or have the post hook not only refill the !cache, but also remember the timestamp (to be used only here (and maybe for the atom feed))?
good spotting... I guess it is silly to recalculate this from the cache, every time...
Should the cache be extended to also store the last tag timestamp, the last article timestamp, the list of tags, etc... ?
this is not very clear to me... atm the cache contains the articles, but no caching of listings or tags is done... maybe they should be cached (as you might have noticed here I prefer to have as little done as possible on each individual request)?
For this change request here, I'd just use the store.last_commit () >>= fun updated, the same used for the atom feed. Caching can come in a separate PR, but @Engil should tell his opinion :)
I am happy to change the code to use store.last_commit () >>= fun updated for this PR, but what if the last commit was not a new tag but a new article ? Shouldn't the Etag (for the /tags page) reflects the set of existing tags only ?
yep, that's an conservative approximation and will result in more data being transferred in the worst case than needed... but better than an underapproximation which leads to outdated data on the clients.. ;) a new article might as well introduce new tags, as might a change to an existing article.. the logic how to get the last update to any tag (add/remove) is non-trivial
I think at some point we should improve the cache mechanism (which is a Map other Canopy_content.t right now), abstracting thing in such a way we can cache easily other things than articles.
I'm not too sure on how to do that properly, for now this solution works fine enough, we'll see later for something more clever
Everything looks fine to me, tested it just now, looks great! (was a bit busy this week end again, sorry for being late to the party…)
Thank you @hannesm for reviewing everything, and thank you @voila again for delivering such nice PRs…
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.