Previous Thread
Next Thread
Print Thread
Hop To
Joined: Sep 2010
Posts: 97
V
member
member
V Offline
Joined: Sep 2010
Posts: 97
Here's the problem. I have a site for users to sell stuff. Most of them include pictures which is hard on the bandwidth. A member PMed me and suggested the following. But I don't have a clue as to what he's talking about. Maybe one of you can make some sense of it and let me know if it's worth doing.

Hey,

I noticed last night that VAGT was down, when it was back up this morning, I decided to do some investigating...

The biggest problem is that nothing on the site is set to be cached by the web browser! So what happens is that everytime you go to view the same topic, the images are downloaded again. For example, when you reply, or check up on your post, or just visit the same post multiple times.

I went and pulled out the relevant useful parts out of one of my web project's .htaccess file, if you add these to VAGT you should significantly reduce bandwidth usage and page load time:

# Turn off ETags
FileETag none

# Enable expiration
ExpiresActive On

# Set js/css/images to expire far in the future so that they are cached
ExpiresByType application/javascript "access plus 10 years"
ExpiresByType text/css "access plus 10 years"
ExpiresByType image/gif "access plus 10 years"
ExpiresByType image/png "access plus 10 years"
ExpiresByType image/jpeg "access plus 10 years"
ExpiresByType image/vnd.microsoft.icon "access plus 10 years"

# Insert filter
SetOutputFilter DEFLATE

# Netscape 4.x has some problems...
BrowserMatch ^Mozilla/4 gzip-only-text/html

# Netscape 4.06-4.08 have some more problems
BrowserMatch ^Mozilla/4\.0[678] no-gzip

# MSIE masquerades as Netscape, but it is fine
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Don't compress images
SetEnvIfNoCase Request_URI \
\.(?:gif|jpe?g|png)$ no-gzip dont-vary

# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary

Joined: Apr 2007
Posts: 3,940
Likes: 1
SD Offline
Former Developer
Former Developer
Joined: Apr 2007
Posts: 3,940
Likes: 1
yeppers, i do much the same for my sites

although 10yrs is a wee bit extreme laugh


Joined: Sep 2010
Posts: 97
V
member
member
V Offline
Joined: Sep 2010
Posts: 97
how is this done?

Joined: Sep 2010
Posts: 97
V
member
member
V Offline
Joined: Sep 2010
Posts: 97
Originally Posted by Sirdude
yeppers, i do much the same for my sites

although 10yrs is a wee bit extreme laugh

Sending you a PM SirDude


Link Copied to Clipboard
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Recent Topics
Bots
by Outdoorking - 04/13/2024 5:08 PM
Can you add html to language files?
by Baldeagle - 04/07/2024 2:41 PM
Do I need to rebuild my database?
by Baldeagle - 04/07/2024 2:58 AM
This is not a bug, but a suggestion
by Baldeagle - 04/05/2024 11:25 PM
spam issues
by ECNet - 03/19/2024 11:45 PM
Who's Online Now
1 members (Ruben), 802 guests, and 202 robots.
Key: Admin, Global Mod, Mod
Random Gallery Image
Latest Gallery Images
Los Angeles
Los Angeles
by isaac, August 6
3D Creations
3D Creations
by JAISP, December 30
Artistic structures
Artistic structures
by isaac, August 29
Stones
Stones
by isaac, August 19
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20230217)