Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Persist cached formatted_data #172

Open
Naatan opened this issue Sep 2, 2015 · 11 comments
Open

Persist cached formatted_data #172

Naatan opened this issue Sep 2, 2015 · 11 comments

Comments

@Naatan
Copy link

Naatan commented Sep 2, 2015

Reference discussion: #77 (comment)

formatted_data is only cached for the class instance, invoking gollum-lib again will cause it to load the page all over again. Gollum appears to be affected by this (gollum-lib caching has no effect when using gollum).

Ideally this information should be stored and accessible for the duration of the process.

@dometto
Copy link
Member

dometto commented Sep 2, 2015 via email

@Naatan
Copy link
Author

Naatan commented Sep 2, 2015

Gollum should be initializing a new instance of Precious::App for each request

I just tested this, Precious:App is only initialized once at startup.

@dometto
Copy link
Member

dometto commented Sep 2, 2015

Ah, thanks, that explains. My bad, should have thought more before responding. :)

I very much welcome a PR on the lines of #77. Having Cache adapters is an especially nice idea, making it easy to plug in any kind of cache server if wanted.

There are some gems that a implement a basic in-memory cache, like https://github.com/djreimer/mini_cache -- although the only ones I can find that seem to be well maintained are ones that use a separate redis or memcache server. Something like mini_cache might still be useful inspiration though.

If anyone is interested in developing this, I'd be glad to advise where possible.

@dometto
Copy link
Member

dometto commented Sep 2, 2015

And there is of course ActiveSupport::Cache, but I don't know how lean it is to require.

@Naatan
Copy link
Author

Naatan commented Sep 2, 2015

Perhaps it's worth reconsidering #77? This seems to do pretty much what you described. Seems the only hold up there was some nitpicking (I mean that in the nicest way possible) that could easily be addressed on a follow up commit by those giving the feedback, it seems silly to block a good PR simply because you'd do a few things differently (not to mention it deters people from contributing in the first place).

@dometto
Copy link
Member

dometto commented Sep 2, 2015

I'm all fine with the approach in #77, but someone will have to clone the code and open a new PR since the original author has no time for it. :)

@Naatan
Copy link
Author

Naatan commented Sep 2, 2015

@sirupsen do you want to open a new PR or mind if someone else uses your code to open a PR?

I got it working over at https://github.com/Komodo/gollum-lib, although the commits are a bit of a mess and need some cleaning up before I'd PR them.

@sirupsen
Copy link
Contributor

sirupsen commented Sep 3, 2015

You have fresh context, please grab the code and open a new PR :)

@dometto
Copy link
Member

dometto commented Sep 3, 2015

Thanks @sirupsen! Yeah, let's grab the code. It would be good to have a mechanism for ensuring the cache doesnt get too big though -- that's why I mentioned other caching gems.

@bartkamphorst
Copy link
Member

@Naatan Any chance you'd be willing to open a PR for caching based on the work in your fork?

@dometto
Copy link
Member

dometto commented Apr 30, 2017

ping We're working hard on version 5.x so this would be a great time to implement caching.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants