Lowering Cloudfront bill

Discussion in 'Programming' started by liror, Apr 29, 2015.

  1. #1
    hey guys

    i am using amazon cloudfront CDN cache for my website, i am using it with W3 Total Cache.
    my site is full with images and currently the bill is getting high from all the usage , i am looking to see if there are any ways i can some how lower the monthly bill,

    anyone might have any idea on ways to tweak either the w3 total cache plugin or the cloudfront setting in order to pay less?

    much appreciated
    John
     
    liror, Apr 29, 2015 IP
  2. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #2
    Could we see the site in question?

    A great many sites where you end up resorting to a CDN could actually be hosted faster in far less resources if you just optimized images, used image recombination techniques, combined static elements together and used less total assets. I know that should be obvious, but it seems people miss that a LOT.

    Your images might not even be the big problem -- Scripting for nothing, separate stylesheets for nothing, there's a whole host of crap that might be on your site that could be having far, FAR more of an impact.

    Of course, W3 Total Cache being a turdpress plugin means you already have a bloated poorly written train wreck of a site where you probably should have optimized BEFORE diving for the CDN. Given the endless scripttardery for nothing, bloated non-semantic markup, and tendency to waste megabytes of scripting and CSS on doing two or three dozen K's job, there's probably a LOT that should have been fixed before resorting to "let's throw more hardware at it" and "let's throw more code at it!"

    Neither of which is usually a great solution until after you've expended every other way of speeding things up or making sure there's nothing severely wrong that needs to be fixed; and again since it sounds like you've got turdpress just how hard did you bend that train wreck of ineptitude over the table to make it your *****? If you went with some crappy off the shelf template to then blindly threw endless "plugins/mods/extensions/whateverThey'reCalledThisWeek" at it, well... no wonder you might be having problems. Not saying that's what you did, but I suspect that's what you did.

    In fact I would go so far as to say that in my experience the vast majority of sites resorting to CDN's with all but a few exceptions could probably be hosted on a $10/mo VPS if they were written with good coding practices, less scripttardery for nothing, and on properly configured hosting!

    I know what I just said is the exact opposite of the advice you'll find out there right now, even from things like Google PageSpeed insights. You'd almost think the people telling you to throw more code and more hardware at it were shilling for people selling CDN's or something, or even offering their own "service" that pisses all over accessibility and makes fast sites slower. I'm not saying said common advice from the likes of Google has zero trustworthiness anymore; no, correction, that's EXACTLY what I'm saying!

    Honestly I say the same thing about dicking with cache expiration times; if there was something so horribly wrong with the browser defaults don't you think the browser makers would have changed them?

    Again though, that's all wild guesses without actually seeing the site in question. It's an educated guess the moment the disaster known as turdpress is in the mix; double that if jQuery is present, double it again if some mouth-breathing idiotic HTML/CSS "Framework" like bootcrap is involved... but still, if we could see the site more meaningful advice could likely be offered.

    A file count and size analysis as well as breakdown of how much of each page is ACTUALLY using, as well as checking to see if cache is being leveraged properly sounds in order.

    Also, are you performing any resizing/optimization of said images? Are you loading them raw every time or are you generating thumbs and only loading the full version when users use it?

    There's a LOT we can't tell you without seeing the site you are asking about!
     
    deathshadow, Apr 29, 2015 IP
  3. liror

    liror Active Member

    Messages:
    289
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    70
    #3
    wow thank u so much for this detailed reply , i am not really interested in writing my site URL in public but i can let you know in a PM if you agree? thanks again!:)
     
    liror, Apr 29, 2015 IP
  4. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #4
    PM away, I'm willing to take a look and see what I can see; you might have a LOT of work ahead of you depending on what I find, but doing things "properly" to fix problems can directly reduce hosting costs and requirements if it hasn't been done. From inefficient/bloated markup, broken caching models, excessive number of separate files resulting in too many handshakes, to the "JS for nothing" that is so commonplace these days, most sites are chock full of things that should be fixed BEFORE "throwing more hardware at it"

    WORD OF WARNING, you might find my analysis a bit harsh; I'm an old school New England Yankee and 80's business stereotype, with a healthy dose of drill instructor thrown in for good measure. I'm going to tell you how it is, and that may involve a LOT more work and throwing away a LOT more of your site than you may expect; I do not sugar coat things -- soothing syrup? Playing nice? That's for people who want to fail.

    Or as the saying goes, an ounce of sweat now can save a pint of blood later. Sounds like in terms of hosting costs you are already bleeding; while again I'm guessing wildly, just from what you've said it sounds like that ounce of sweat step was skipped by using off the shelf solutions... and you are now hitting up against why I'm NOT a fan of just slapping together off the shelf solutions.
     
    deathshadow, Apr 29, 2015 IP