librelist archives

« back to archive

Re: [nesta] Caching with Nesta 0.9.3

Re: [nesta] Caching with Nesta 0.9.3

From:
Graham Ashton
Date:
2012-09-24 @ 09:01
Hi Aaron. At a guess I'd suggest that maybe Nesta doesn't have permission 
to write its cache files on your server. 

Things to check:

- can the user that your web server runs as create files in your project 
folder?  (it only needs to access to do so inside the "public" folder in 
your project folder) 

- do you have any log files that will contain a useful error message? 

Let us know more about how you're hosting it if you still can't get going,
and we may be able to make some more suggestions. 

Cheers, 
Graham 

aaron addleman <aaronaddleman@gmail.com> wrote:

>Hi Graham,
>
>
>I hope this topic is not a repeat (and if it is, could you please send me
info on it?) about setting the caching variables. I created a new Nesta 
site and copied the files to my hosting service. When I set the variable 
in the config.yml of "cache: true" the site resulted in an error of 
something like:
>
>
>Sorry, something went wrong
>
>
>An error occurred whilst we were trying to serve your page. Please bear 
with us, or try another page.
>
>
>Is there something I am doing wrong? How should I enable caching with 
Apache and Passenger?
>
>
>Thanks in advance,
>
>Aaron
>

Re: [nesta] Caching with Nesta 0.9.3

From:
aaron addleman
Date:
2012-09-24 @ 20:43
Hi Graham,

Thanks for getting back to me! I did check the permissions on the public
directory and all seems to be okay with regard to the group being able to
write to the public directory. I did start to look at the Nesta gem files
and change a couple lines and the caching started to work. So I am really
curious (for the sake of learning) if what I did was right? or,.. is there
a way to implement my changes without editing the Nesta gem files?

I did check the log files and did not see any errors. But im assuming that
I don't know how to properly turn on logging for Sinatra based applications.

My changes are showen on my site:

http://aaronaddleman.com/articles/nesta-caching

Thanks in advance,
Aaron

On Mon, Sep 24, 2012 at 2:01 AM, Graham Ashton <graham@effectif.com> wrote:

> Hi Aaron. At a guess I'd suggest that maybe Nesta doesn't have permission
> to write its cache files on your server.
>
> Things to check:
>
> - can the user that your web server runs as create files in your project
> folder? (it only needs to access to do so inside the "public" folder in
> your project folder)
>
> - do you have any log files that will contain a useful error message?
>
> Let us know more about how you're hosting it if you still can't get going,
> and we may be able to make some more suggestions.
>
> Cheers,
> Graham
>
> aaron addleman <aaronaddleman@gmail.com> wrote:
>
> Hi Graham,
>
> I hope this topic is not a repeat (and if it is, could you please send me
> info on it?) about setting the caching variables. I created a new Nesta
> site and copied the files to my hosting service. When I set the variable in
> the config.yml of "cache: true" the site resulted in an error of something
> like:< /div>
>
> Sorry, something went wrong
>
> An error occurred whilst we were trying to serve your page. Please bear
> with us, or try another page.
>
> Is there something I am doing wrong? How should I enable caching with
> Apache and Passenger?
>
> Thanks in advance,
> Aaron
>

Re: [nesta] Caching with Nesta 0.9.3

From:
Graham Ashton
Date:
2012-09-26 @ 15:07
On 24 Sep 2012, at 21:43, aaron addleman <aaronaddleman@gmail.com> wrote:

> So I am really curious (for the sake of learning) if what I did was 
right? or,.. is there a way to implement my changes without editing the 
Nesta gem files?

Oh dear, this is largely my fault for not having released a new version 
particularly recently. Sorry about that.

> My changes are showen on my site:
> 
> http://aaronaddleman.com/articles/nesta-caching

Back in March, I made this commit, which I'd since forgotten all about:

https://github.com/gma/nesta/commit/ded44959aca60973dc8c736364384d7f42d9ecca

It was made after 0.9.13 came out, so that explains your first change.

Did you definitely need your second change (setting public_dir and 
cache_dir)? If you do, the way I'd do it would be in an app.rb file.

$ cd path/to/project
$ $EDITOR app.rb

Then put this in app.rb:

module Nesta
  class App
    set :public_dir, 'public'
    set :cache_dir, 'public/cache'
  end
end

I'd quite like to hear about it if those two aren't appropriately set by 
default, as that would mean something's not quite right.

If you'd like to run the latest version before 0.9.13 comes out, this 
article will explain how to do it:

http://nestacms.com/docs/recipes/running-the-latest-code

Cheers,
Graham

-- 
Graham Ashton
Founder, The Agile Planner
http://theagileplanner.com | @agileplanner | @grahamashton

Re: [nesta] Caching with Nesta 0.9.3

From:
aaron addleman
Date:
2012-09-26 @ 16:11
Hi Graham!

Thanks for getting back so quickly! Also, I should say, I really like your
work on this application and have been bragging about it with all my
friends! So my hat tip to you sir for writing a great app.

No need for apologies. Im glad you were able to find the problem =) This is
also a learning lesson for me, search the repo first hehe !!

I will try running the latest code and let you know my results with setting
the variables in the app.rb.

Cheers,
Aaron

On Wed, Sep 26, 2012 at 8:07 AM, Graham Ashton <graham@effectif.com> wrote:

> On 24 Sep 2012, at 21:43, aaron addleman <aaronaddleman@gmail.com> wrote:
>
> > So I am really curious (for the sake of learning) if what I did was
> right? or,.. is there a way to implement my changes without editing the
> Nesta gem files?
>
> Oh dear, this is largely my fault for not having released a new version
> particularly recently. Sorry about that.
>
> > My changes are showen on my site:
> >
> > http://aaronaddleman.com/articles/nesta-caching
>
> Back in March, I made this commit, which I'd since forgotten all about:
>
>
> https://github.com/gma/nesta/commit/ded44959aca60973dc8c736364384d7f42d9ecca
>
> It was made after 0.9.13 came out, so that explains your first change.
>
> Did you definitely need your second change (setting public_dir and
> cache_dir)? If you do, the way I'd do it would be in an app.rb file.
>
> $ cd path/to/project
> $ $EDITOR app.rb
>
> Then put this in app.rb:
>
> module Nesta
>   class App
>     set :public_dir, 'public'
>     set :cache_dir, 'public/cache'
>   end
> end
>
> I'd quite like to hear about it if those two aren't appropriately set by
> default, as that would mean something's not quite right.
>
> If you'd like to run the latest version before 0.9.13 comes out, this
> article will explain how to do it:
>
> http://nestacms.com/docs/recipes/running-the-latest-code
>
> Cheers,
> Graham
>
> --
> Graham Ashton
> Founder, The Agile Planner
> http://theagileplanner.com | @agileplanner | @grahamashton
>
>