News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

index.php?action=dlattach

Started by Debbie2, January 24, 2007, 04:31:26 AM

Previous topic - Next topic

Debbie2

SMF Version: SMF 1.1
On my forum, the avatars are stored on the web server, but all of them require a call to index.php, so when someone loads a forum topic full of avatars the web server logs look like this:

82.239.214.16 - - [24/Jan/2007:03:27:42 -0600] "GET /forums/index.php?action=dlattach;attach=9563;type=avatar HTTP/1.0" 200 2705
82.239.214.16 - - [24/Jan/2007:03:27:42 -0600] "GET /forums/index.php?action=dlattach;attach=8520;type=avatar HTTP/1.0" 200 5635
82.239.214.16 - - [24/Jan/2007:03:27:42 -0600] "GET /forums/index.php?action=dlattach;attach=6299;type=avatar HTTP/1.0" 200 7656
82.239.214.16 - - [24/Jan/2007:03:27:42 -0600] "GET /forums/index.php?action=dlattach;attach=609;type=avatar HTTP/1.0" 200 4566

I'm concerned about this wasting a lot of CPU time because my forums have been running too slow recently.

I noticed the Simple Machines Community Forum doesn't do that---the avatars are links to static image files instead. Is this a new feature in SMF 1.1.1 or what?

    [/size][/list]
    [/

    127.0.0.1

    Those are interesting points you raise. I'd be interested in the answers as well. Especially why the development build of SMF uses direct access to avatars.

    Perhaps you can obtain the answer to your first question by experimenting a little. At the bottom of each SMF page there is text that reads Page rendered in _____ seconds... Via the admin center (Admin > Current Theme > Show user avatars in message view) you can temporarily disable the display of avatars. Then compare the times it takes to render the same page with and without the avatars. If the difference is significant I suppose you have your answer.

    vbgamer45

    Yes it does increase cpu usage. Here is how you can use static avatar links from Ben S

    Quote
    If you allow users to upload their own avatars, move them to a specific directory rather than have them handled through the attachments system. This way you will save a big chunk of resources since they are served in a "normal way" rather than through index.php

    You can do this through Admin > Attachments and Avatars > Avatar Settings > Upload avatars to > Specific directory.

    Naturally create the directory and make it writable.

    To move existing avatars to the new directory, access index.php?action=manageattachments;sa=moveAvatars

    Be warned though your page views stats will drop to the floor, for some reason webalizer and awstats wrongly think an avatar loaded on a page is a page itself rather than a hit.
    Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

    SMFHacks.com -  Paid Modifications for SMF

    Mods:
    EzPortal - Portal System for SMF
    SMF Gallery Pro
    SMF Store SMF Classifieds Ad Seller Pro

    127.0.0.1

    Vbgamer,

    I remember I made a script for something or another where I used a direct call to the avatar image rather than going through dlattach. I noticed old avatars would often stay cached regardless if a newer avatar was uploaded to replace it. Does SMF DE have this issue? If not how did you guys get around that?

    vbgamer45

    The above quote from Ben S uses direct links instead of dlattach.
    Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

    SMFHacks.com -  Paid Modifications for SMF

    Mods:
    EzPortal - Portal System for SMF
    SMF Gallery Pro
    SMF Store SMF Classifieds Ad Seller Pro

    127.0.0.1

    I realise that. I was inquiring if there were any cache issues using that method, because I experienced many with the similar method. It appears not though on this forum as I uploaded several avatars with the same extension and the browser shows the correct avatar each time.

    Fiery

    Hello,

    I am just following up on old support topics.

    Were you able to get everything to work for you correctly?

    Thanks

    Advertisement: