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

photo is not updated when changed #866

Closed
thatkookooguy opened this issue Jan 27, 2017 · 3 comments
Closed

photo is not updated when changed #866

thatkookooguy opened this issue Jan 27, 2017 · 3 comments

Comments

@thatkookooguy
Copy link

thatkookooguy commented Jan 27, 2017

I'm changing the shield text on my server side but GitHub doesn't refresh the shield itself.
when I open the path in a new tab, I get the new image. But on GitHub, I get the old one.
I thought it might be caching, so I added all the headers I know of that disable caching, but still no success.

app.get('/achievementsBadge', function(req, res) {
  badge.loadFont('./Verdana.ttf', function(err) {
    badge({ text: ["achievements", _.keys(achievements).length], colorA: "#894597", colorB: "#5d5d5d", template: "flat" },
      function(svg, err) {
        res.setHeader('Content-Type', 'image/svg+xml;charset=utf-8');
        res.setHeader('Pragma-directive', 'no-cache');
        res.setHeader('Cache-directive', 'no-cache');
        res.setHeader('Cache-control', 'no-cache');
        res.setHeader('Pragma','no-cache');
        res.setHeader('Expires','0');
        res.send(svg);
      });
  });
});

Any hints on how to solve this problem?

Thanks :-)

@espadrine
Copy link
Member

Does this help?

@thatkookooguy
Copy link
Author

Yes, the header you sent a reference to did help and made our shield update :-)

Sorry it took some time. testing cache required some waiting time haha

thanks a lot for the help!
closing this issue as solved

@espadrine
Copy link
Member

No worries!

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