in reply to : get your perlmonks flair!

Since the flair is cached for 5 days, it doesn't reflect the real experience points. Is there any possibility to check an actual exp level and generate the new flair if smth changed?
  • Comment on Re: : get your perlmonks flair!

Replies are listed 'Best First'.
Re^2: : get your perlmonks flair!
by gideondsouza (Pilgrim) on Sep 23, 2013 at 14:59 UTC

    I'm not entirely sure if I get you. Are you saying I should fetch the XP and check if it has changed? It would defeat the purpose of caching a bit. I have an extremely light server running this app and wanted to avoid the call to the site itself. is very slow, and making calls to check it everytime would be expensive.

    As alternatives I was thinking of (1) A sliding cache window, if your XP updates frequently then I will cache less frequently. But this is hard because it means I have to write a varnish plugin. (2) A feature to allow users to refresh the cache for just their flair. This is slightly more do-able

    If you submit it as an issue I will take this up when I can:

      A feature to allow users to refresh the cache for just their flair. This is slightly more do-able

      That would be quite useful, especially for the newly-initiated who move through the levels faster than established monks. Something like<username>.jpg?purge to force an update, perhaps?

      You may want to keep an eye on how much that's used so that people don't put too much load on the server by constantly purging their badge, of course. Alternatively, you could do some sort of rate limiting for purging as well -- say, once per day, or (if you want to allow a little more flexibility) three times per day and seven times per week.

      Thanks to both you and your friend for creating this, BTW!

        Hi AppleFritter,

        Sorry about the late reply. I've been a little off grid lately with work.

        I'll be writing another Perl web project pretty soon :)

        The problem with this purge thing is I use Varnish so to support something like a url?purge will involve writing a varnish plugin! Alternatively varnish does support sending a request with the verb as "PURGE" but I may have not enabled this.

        I gave up looking for a simple way to do this, but I'll give the whole thing another looksee soon.

        Thank you very much for your appreciation :)