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

Blog caching #507

Closed
lucassmagal opened this Issue Sep 7, 2012 · 18 comments

Comments

Projects
None yet
6 participants
@lucassmagal

Hello guys,

I have, finally, deployed my blog. I'm still hacking the theme, but almost everything is fine, except one thing: browser page caching.

How are you dealing with it?

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Sep 7, 2012

Member

Hi Lucas. I haven't had any issue with browser page caching, so there hasn't been anything for me to deal with. Why don't you hop onto IRC via either...

... where it will be easier to help you. Thanks!

Member

justinmayer commented Sep 7, 2012

Hi Lucas. I haven't had any issue with browser page caching, so there hasn't been anything for me to deal with. Why don't you hop onto IRC via either...

... where it will be easier to help you. Thanks!

@onlyhavecans

This comment has been minimized.

Show comment
Hide comment
@onlyhavecans

onlyhavecans Sep 7, 2012

Member

Are you referring to, when developing a theme how do deal with the fact that the browser caches artifacts, forcing you to HARD reload every time or not see your changes?

This is the universal developers query and there is many ways of dealing with it. I use a program called coda, which is a web ide that has a debugging browser that never caches. Cheaper solutions include developer plugins for your favorite browser, or debug mode (like in safari) which has a disable caches options

Member

onlyhavecans commented Sep 7, 2012

Are you referring to, when developing a theme how do deal with the fact that the browser caches artifacts, forcing you to HARD reload every time or not see your changes?

This is the universal developers query and there is many ways of dealing with it. I use a program called coda, which is a web ide that has a debugging browser that never caches. Cheaper solutions include developer plugins for your favorite browser, or debug mode (like in safari) which has a disable caches options

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Sep 7, 2012

Member

No IRC love. Like a jilted paramour, my heart is in tatters. 😞

FWIW, I use Safari in regular, non-debug mode, and all I need to do is a normal page reload to update the cached assets. I serve the files locally via python -m SimpleHTTPServer and http://localhost:8000/ instead of viewing files directly in the browser. (e.g., file:///mysite/index.html)

Member

justinmayer commented Sep 7, 2012

No IRC love. Like a jilted paramour, my heart is in tatters. 😞

FWIW, I use Safari in regular, non-debug mode, and all I need to do is a normal page reload to update the cached assets. I serve the files locally via python -m SimpleHTTPServer and http://localhost:8000/ instead of viewing files directly in the browser. (e.g., file:///mysite/index.html)

@sigmavirus24

This comment has been minimized.

Show comment
Hide comment
@sigmavirus24

sigmavirus24 Sep 7, 2012

Contributor

I know that feel @justinmayer. I also always test locally before deploying it with the simple server that python has so I don't encounter this either with Firefox.

Contributor

sigmavirus24 commented Sep 7, 2012

I know that feel @justinmayer. I also always test locally before deploying it with the simple server that python has so I don't encounter this either with Firefox.

@onlyhavecans

This comment has been minimized.

Show comment
Hide comment
@onlyhavecans

onlyhavecans Sep 7, 2012

Member

Sorry for trying to be helpful!!! sigh ;p
The develop_server.sh script init's both python's simple server and pelican auto-reload in debug mode. I wrote this because those two combined I found perfect for theme development

Member

onlyhavecans commented Sep 7, 2012

Sorry for trying to be helpful!!! sigh ;p
The develop_server.sh script init's both python's simple server and pelican auto-reload in debug mode. I wrote this because those two combined I found perfect for theme development

@lucassmagal

This comment has been minimized.

Show comment
Hide comment
@lucassmagal

lucassmagal Sep 7, 2012

No, I'm not having problems with browser caching during development, the problem is when the code is deployed... currently I'm using heroku with ruby's Rack TryStatic middleware.

No, I'm not having problems with browser caching during development, the problem is when the code is deployed... currently I'm using heroku with ruby's Rack TryStatic middleware.

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Sep 7, 2012

Member

Hmm. As the BunnyMan said in his original comment, there's nothing about browser asset caching that's specific to Pelican. Perhaps the Heroku or Rack communities would be better positioned to help.

In any case, this sounds like a Rack config issue. Do you have static asset caching enabled anywhere? Anything like this?

require "rack/contrib/static_cache"
use Rack::StaticCache, [...]
Member

justinmayer commented Sep 7, 2012

Hmm. As the BunnyMan said in his original comment, there's nothing about browser asset caching that's specific to Pelican. Perhaps the Heroku or Rack communities would be better positioned to help.

In any case, this sounds like a Rack config issue. Do you have static asset caching enabled anywhere? Anything like this?

require "rack/contrib/static_cache"
use Rack::StaticCache, [...]
@onlyhavecans

This comment has been minimized.

Show comment
Hide comment
@onlyhavecans

onlyhavecans Sep 7, 2012

Member

So you deploy but old content is still being displayed?
I've never had or heard of a problem like that before.

I'm inexperienced with heroku so I can't help, sorry.

Member

onlyhavecans commented Sep 7, 2012

So you deploy but old content is still being displayed?
I've never had or heard of a problem like that before.

I'm inexperienced with heroku so I can't help, sorry.

@lucassmagal

This comment has been minimized.

Show comment
Hide comment
@lucassmagal

lucassmagal Sep 7, 2012

@tbunnyman , yes, I can only see the new content with a hard reload =S

@justinmayer , no, I'm not aware of these Rack configurations. Is there anyone using Rack to serve a pelican blog or it's just me?

@tbunnyman , yes, I can only see the new content with a hard reload =S

@justinmayer , no, I'm not aware of these Rack configurations. Is there anyone using Rack to serve a pelican blog or it's just me?

@onlyhavecans

This comment has been minimized.

Show comment
Hide comment
@onlyhavecans

onlyhavecans Sep 7, 2012

Member

I know someone other than yourself has mentioned it but no complaints.

Member

onlyhavecans commented Sep 7, 2012

I know someone other than yourself has mentioned it but no complaints.

@honzajavorek

This comment has been minimized.

Show comment
Hide comment
@honzajavorek

honzajavorek Sep 9, 2012

Contributor

I deployed my Pelican to GitHub pages and this also happened to me. Browser cached my statically served pages and I had to perform hard reload to get the newest document. As I generated some little stuff by cron on daily basis (list of events), it was not very nice, because my visitors had seen expired list of events from yesterday until they hardrefreshed the page (but no normal person does this, really). As there is no way to change the way GitHub serves static pages (e.g. HTTP headers, I think you could adjust them to somehow prevent such behaviour, at least for often-changing pages), I finally decided to move it to Heroku - I turned the list of events into a proper, dynamic Python/Flask Heroku app.

Contributor

honzajavorek commented Sep 9, 2012

I deployed my Pelican to GitHub pages and this also happened to me. Browser cached my statically served pages and I had to perform hard reload to get the newest document. As I generated some little stuff by cron on daily basis (list of events), it was not very nice, because my visitors had seen expired list of events from yesterday until they hardrefreshed the page (but no normal person does this, really). As there is no way to change the way GitHub serves static pages (e.g. HTTP headers, I think you could adjust them to somehow prevent such behaviour, at least for often-changing pages), I finally decided to move it to Heroku - I turned the list of events into a proper, dynamic Python/Flask Heroku app.

@lucassmagal

This comment has been minimized.

Show comment
Hide comment
@lucassmagal

lucassmagal Sep 9, 2012

@honzajavorek , that's what I'm trying to do now... I'm changing some Ruby/Rack configurations to see what can solve this kind of problem.

So... what's your Flask app? Can you share this code with me?

@honzajavorek , that's what I'm trying to do now... I'm changing some Ruby/Rack configurations to see what can solve this kind of problem.

So... what's your Flask app? Can you share this code with me?

@honzajavorek

This comment has been minimized.

Show comment
Hide comment
@honzajavorek

honzajavorek Sep 9, 2012

Contributor

@lucassmagal I actually completely rewritten the whole thing into normal dynamic app. So it's not a solution for you. I had a list of events generated by cron into a static page. I turned it into full-featured dynamic Flask app with views, the list of events is generated on request now.

Contributor

honzajavorek commented Sep 9, 2012

@lucassmagal I actually completely rewritten the whole thing into normal dynamic app. So it's not a solution for you. I had a list of events generated by cron into a static page. I turned it into full-featured dynamic Flask app with views, the list of events is generated on request now.

@lucassmagal

This comment has been minimized.

Show comment
Hide comment
@lucassmagal

lucassmagal Sep 9, 2012

@honzajavorek , it seems a interesting approach, even it's not a solution for me, I'm really curious about it.

@honzajavorek , it seems a interesting approach, even it's not a solution for me, I'm really curious about it.

@honzajavorek

This comment has been minimized.

Show comment
Hide comment
@honzajavorek

honzajavorek Sep 10, 2012

Contributor

@lucassmagal Well, look here for the original app: https://github.com/honzajavorek/zitkino Now I am trying to turn it into proper app. It's not done yet, I develop it in https://github.com/honzajavorek/zitkino/tree/standalone-app.

Contributor

honzajavorek commented Sep 10, 2012

@lucassmagal Well, look here for the original app: https://github.com/honzajavorek/zitkino Now I am trying to turn it into proper app. It's not done yet, I develop it in https://github.com/honzajavorek/zitkino/tree/standalone-app.

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Sep 13, 2012

Member

I think this discussion has run its course. Issue closed.

Member

justinmayer commented Sep 13, 2012

I think this discussion has run its course. Issue closed.

@eamonnfaherty-productmadness

This comment has been minimized.

Show comment
Hide comment
@eamonnfaherty-productmadness

eamonnfaherty-productmadness Jul 21, 2015

I am having the same issue.

I am deploying to github pages using travisci and I have to hard reload the home page to see the most up to date version.

Is there any solution to this?

I am having the same issue.

I am deploying to github pages using travisci and I have to hard reload the home page to see the most up to date version.

Is there any solution to this?

@justinmayer

This comment has been minimized.

Show comment
Hide comment
@justinmayer

justinmayer Jul 21, 2015

Member

@eamonnfaherty-productmadness: This doesn't have anything to do with Pelican. Moreover, what you are describing sounds, to me, the way browser caching is designed to work. I don't understand what the perceived problem is.

Member

justinmayer commented Jul 21, 2015

@eamonnfaherty-productmadness: This doesn't have anything to do with Pelican. Moreover, what you are describing sounds, to me, the way browser caching is designed to work. I don't understand what the perceived problem is.

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