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

Removing cache_ttl does not flush cache #37

Closed
ElDavoo opened this issue Sep 6, 2021 · 3 comments
Closed

Removing cache_ttl does not flush cache #37

ElDavoo opened this issue Sep 6, 2021 · 3 comments

Comments

@ElDavoo
Copy link

ElDavoo commented Sep 6, 2021

Wordpress: 5.6
Documents for Git: 2.1.0

When you add the cache_ttl parameter to your markdown block and then you remove it, the plugin will only serve the last cached version of the document and will stop updating the document.

I didn't config anything

To Reproduce
Steps to reproduce the behavior:

  1. Add a block: [git-gitlab-markdown user="" token="" url="" cache_ttl=""] to a wordpress page
  2. Fill it with valid parameters (i use a private repo)
  3. Save draft and preview.
  4. Remove the cache_ttl parameter.
  5. Update the document on Git{Lab,Hub}.
  6. Save draft and preview.

Expected behavior
You should see the updated version

@nilsnolde
Copy link
Owner

as described in the readme, this is a static cache, meaning you need to give it a update interval with cache_ttl, the default is quite long, 1 week or so, not sure, didn't check. so if you don't provide a global config, that's what you'll get. if you set cache_ttl to 1 (either globally or per shortcode), then it'd update the source every second when someone visits your post.

unless you're trying to use jupyter notebooks, in which case it's a known problem but outside the scope of this project, see #26

@nilsnolde
Copy link
Owner

nilsnolde commented Sep 7, 2021

fwiw, dynamic caching (what you expect, update source, post will be updated) is already described in #20 and is looking for funding :)

@ElDavoo
Copy link
Author

ElDavoo commented Sep 7, 2021

the default is quite long, 1 week or so

Nice ! So I got it wrong: It's not that the flush was not working, is that the default period was being used, as I though removing the cache_ttl would disable the cache completely instead of using the default. My bad!

@ElDavoo ElDavoo closed this as completed Sep 7, 2021
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

2 participants