Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
As far as I can tell from this relatively sparse info, you're both going about this in an either complicated or inefficient way. How about this:

1. Whenever a pageview for a given timespan and event-selection is requested, generate that page, and write it to disc. If the same info is request again, make it as cheap as possible to serve the static page.

2. Whenever a new event is entered or modified/deleted, remove the written pages that are related to that timespan and selection.

3. Send out caching headers for an hour or so for each page.

4. Put a caching proxy in front of your site (definitely worth it, if you've got a fairly serious amount of visitors).

This should ensure that you can serve quite a lot of views on very cheap hardware and hosting (somewhere between 100 and a couple of hundred euros a month in hosting and a few thousand euros of hardware) easily, assuming you're only adding/editing/deleting a handful of event/day on average.

edit: 3 and 4 alone will give you a significant edge without while just generating each page at request (because only a small amount of popular requests will actually end up at your webserver)


In reply to Re: precalculating event dates vs.recalculating them. by Joost
in thread precalculating event dates vs.recalculating them. by schweini

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (8)
    As of 2020-05-25 08:50 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      If programming languages were movie genres, Perl would be:















      Results (144 votes). Check out past polls.

      Notices?