fredmiranda.com
Login

Moderated by: Fred Miranda
  New fredmiranda.com Mobile Site
  New Feature: SMS Notification alert
  New Feature: Buy & Sell Watchlist
  

FM Forums | Leica & Alternative Gear | Join Upload & Sell

1       2       3              end
  

Archive 2007 · Logic of Locking AIT

  
 
TeamSK jay
Offline
• • •
Upload & Sell: Off
p.4 #1 · Logic of Locking AIT


Fred could have done a better job of opening the topic of the AIT and bandwidth but if I just look at the solution, I don't see how simply splitting the thread into chunks has any bearing on how his paid members use his service. Can you connect the data stream dots for me?


Nov 06, 2007 at 11:46 AM
htbyron
Offline
• • •
Upload & Sell: Off
p.4 #2 · Logic of Locking AIT


Paul:

I don't see any reason to disbelieve Fred's explanation that loading the pics onto the server when the thread is opened requires additional bandwidth, wherever those pictures are hosted. And in any event I believe the solution (which many of us in this thread suggested) is a reasonable accommodation of the member's goals and Fred's concerns.

I hope you will reconsider your decision to remove your images from the archived thread -- your shots are inspiring and your contributions have been significant. Please don't punish the rest of this fine community.

Tom



Nov 06, 2007 at 11:50 AM
Fred Miranda
Offline
Admin
Upload & Sell: On
p.4 #3 · Logic of Locking AIT


pdmphoto,
We have a very friendly group, so please drop your insinuations and insults. I have no reason to be dishonest about anything here and am only looking out for the best interests of the forum for all of us. Everything I wrote is based on the data I have.
Let’s get back to photography and move on. Thanks for your understanding and cooperation.



Nov 06, 2007 at 12:28 PM
brainiac
Offline
[X]
p.4 #4 · Logic of Locking AIT


Fred - thanks for a great web site which is one of my favourite places to go on the web. I know a lot of people feel that way.

Scrijptegs
--------------
> I believe the bandwidth hit to FM is caused by those images that are hosted by FM. Specifically, the PHP URL emits an HTTP header to suppress caching: this will cause all images to be refetched as readers flip between pages, or revisit the same page in a subsequent browser session.

I agree. FM hosted files are served as php scripts. I know from experience that doing that can be a source of slowdown. What I do whenever serving a jpeg via php is have the script that serves it simultaneously write the file to the server. If someone then requests the file again, it comes as a simple file path instead of this: [https://www.fredmiranda.com/forum/message.php?Action=downloadfile&FileID=218681

Fred, why don't you try caching jpegs instead of serving them as scripts? If you like I am happy to give you my own code which does exactly that.

Image Size
----------------
Images are served in sizes wider than the browser width. The server should serve files in a size which fits. The data-size of files served will drop dramatically. Again, Fred, I am happy to give you my php/javascript code which solves this problem and will lighten the load on your servers for jpegs hosted on FM.

Wasteful output
----------------------
Looking at the page source code of normal pages here, honestly Fred, I can halve the number of bytes being served. You are not harnessing the awesome collective power of your visitors computers by using javascript to expand content. You aren't even applying DRY (don't repeat yourself) principles in CSS. On this very page, the code
span style='color:#ffffff;font-weight:bolder;font-family:verdana,Arial,Helvetica,sans-serif;font-size:14px'

appears EIGHT TIMES! That's just one of hundreds of places in this page where your html/css is really wasteful. I might even do better than halving the output for an identical result.

Javascript is so universal now that you should be building the pages like this:
function dc(uid, uname, uaddr, avatarurl, comid, text){
    write('blah blah ' + uname + )
    write('blah blah<img src="/avatars/' + avatarurl + '.jpg">')
    write('blahblah' + js_processors(text))
    write('<input type=button id=' + comid + ' value="delete">' et cetera)
}
dc(4838,'brainiac','UK',129,128376886,'Thanks Fred...')
dc(4838,'brainiac','UK',129,128376887,'Thanks again...')
dc(4838,'brainiac','UK',129,128376888,'...and again')
dc(4838,'brainiac','UK',129,128376889,'...and again')
dc(1,'Fred','USA',2,128376984,'Shutup Brainiac')

i.e. get the 3GHz beast at the other end to draw the bloody page and take the load off your server...


Connection hogging
---------------------------
It might be worth checking whether jpegs hosted on external servers are keeping the connection alive to your server while those external files slowly download. I think it's unlikely but you never know.

Voting
---------
Finally, a very nice way to reduce wastage is to introduce a voting system per comment. Look no further than slashdot.org for an example of how to do that effectively. When a visitor is only viewing the most popular comments she will be loading the server far less. I have written a comment voting system which simply allows one incremental vote per comment per ip address. As before, you're welcome to that code, or just my ideas on how to do that.

Thanks for a great site Fred. There are lots of great people here, and we want to help make FM even better, not just to make you richer, but also to save ourselves time! ;-)



Nov 06, 2007 at 03:30 PM
brainiac
Offline
[X]
p.4 #5 · Logic of Locking AIT


...and BTW, using a javascript function to draw comments on the client side would make it more feasible to load more than 10 comments in a page, which is one of the ongoing nuisances, since the print thread version has reduced functionality and you can't see which page a particular comment is on.


Nov 06, 2007 at 04:10 PM
brainiac
Offline
[X]
p.4 #6 · Logic of Locking AIT


TP. Please please please let me help you to fix this excruciating turn page bug!


Nov 06, 2007 at 04:11 PM
Fred Miranda
Offline
Admin
Upload & Sell: On
p.4 #7 · Logic of Locking AIT


Hi Richard,
Check your PM.



Nov 06, 2007 at 05:19 PM
Kit Laughlin
Offline
• • • •
Upload & Sell: Off
p.4 #8 · Logic of Locking AIT


Fred: from what I know of this (I host three of my own sites) everything that Richard has observed is accurate—if he were here, I'd be hiring him to optimise my sites!

good luck with this; Richard, we may have to talk off line, after February (current book deadline). Cheers, KL



Nov 06, 2007 at 05:58 PM
rico
Offline
• • • • •
Upload & Sell: Off
p.4 #9 · Logic of Locking AIT


Caching is a feature of HTTP (RFC 2616) without regard to whether the content is a static file or generated dynamically. The simplest bandwidth optimization for FM is the "Expires" header field which specifies when an image will be reloaded (rather than drawn from the cache of the remote browser). This hews to the so-called Expiration Model. Slightly more complex is the Validation Model where finer-grain control is possible. Click below for my visual demo:

http://patternassociates.com/rico/fmtest/a.cgi

This yields a JPEG image. On visiting the link multiple times, you will be aware when it misses your browser cache because it takes 3 seconds to download (and is progressive scan). Every browser click accesses my server for validation using an ETag header field. My demo simply invalidates your cache on the ½ minute mark.

Visit http://patternassociates.com/rico/fmtest/ for the C source code.



Nov 07, 2007 at 05:19 AM
brainiac
Offline
[X]
p.4 #10 · Logic of Locking AIT


Thanks for that info Rico. Is it your experience that all browsers adhere to the RFC, or is it the case that some browsers see .php?blah in the URL and fetch the file regardless of the Expires header?

It seems to me that using normal non-php file paths is still a good idea in the long run, as most hits will not be repeats.

BTW, I notice that command-R in firefox _always_ reloads the file, whereas when I just go to the URL, as you say, the browser respects the Expires header. That's good behaviour. My experience in the past is that not all browsers do the right thing in this regard, but I could be wrong about that, especially as browsers are better these days.



Nov 07, 2007 at 05:44 AM
1       2       3              end




FM Forums | Leica & Alternative Gear | Join Upload & Sell

1       2       3              end
    
 

Welcome back
Log in to your account