Yep, pretty trivial stuff. Oh, except for that one part:

# # Insert code to record votes here #

Yeah, just that little bit of code that pretty much runs the whole site, the whole framework that just doesn't cut'n'paste into such a block very nicely. :)

The only "pretty easy" routes would be to either: A) render the whole page as usual and then, at or near the "last minute", throw all of that work away and instead output a redirect which would then have to render everything all over again; B) do something like you've written but try to yank aside the bits of processing that are required by the vote-casting code (parsing the cookie, loading your user information, the node cache, etc.). Note that (A) also presents a specific problem of rendering the XP Nodelet but then not displaying it; which means someone might miss an announcement of having gained new level powers (not a horrid problem, but something worth avoiding).

Actually, you are only talking about "vote", not any of the other POST situations at PerlMonks. Voting is handled by an opcode, which gets run fairly early in the whole request processing line, so we could switch to a redirect right after that if voting was POSTed. However, I believe we have forms that mix voting with node updates so we'd have to look into whether those would be messed up by such a change.

I'd rather do something like this for all POST operations -- why "fix" voting but not chatter, node creation, node updates, consideration, etc. But, despite assumptions about how easy something like this must surely be, I'm not convinced that it actually is easy. Certainly, it isn't trivial for me to even work out an easy way to implement it that I'm sure will work without some unfortunately consequences.

I encourage the appointed to look into such a scheme. I've outlined some possible approaches and some potential problems, so there might be a useful starting point there.

- tye        


In reply to Re: Redirect after post for happy bookmarking and refreshing (easy) by tye
in thread Redirect after post for happy bookmarking and refreshing by dorward

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.