bradyvercher / gistpress

WordPress plugin to add Gist oEmbed and shortcode support with caching.
GNU General Public License v2.0
143 stars 28 forks source link

Gist's updated content does not appear #41

Closed srikat closed 10 years ago

srikat commented 10 years ago

I have created a gist (id of 7502706) and used the following shortcode in a Post:

[gist id="7502706" file="style.css"]

I then updated style.css of that gist and made changes.

Upon refreshing my WP post, it still shows the old content of that gist's style.css. Is there a way to have shortcode always render its current content?

bradyvercher commented 10 years ago

Always loading the gist would place a burden on your visitors, your server, and unnecessarily hit GitHub's API, so the gist needs to be cached. I took a look at the link to your site that's in the gist and it appears to be showing the updated code. Were you able to get this to work?

GaryJones commented 10 years ago

@srikat Make a change to your WP Post itself (one character is enough) and then save (and if necessary, undo the change and save again). The act of saving clears the caching of the gists, both raw and processed (with limited range of line numbers, highlighting, no meta showing etc). Just refreshing the front-end view is not enough to trigger the cache clear.

srikat commented 10 years ago

Thanks for the prompt replies guys.

@bradyvercher I actually created a separate gist and used the shortcode to display it in my Post earlier. I have now replaced it with [gist id="7502706" file="style.css"] and it's working fine.

@GaryJones Great! Just what I needed to know.

GaryJones commented 10 years ago

@GaryJones Great! Just what I needed to know.

It is already mentioned in the readme ;-)

If you need to update the snippet with changes made on GitHub, just update the post and the cache will be refreshed.