LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 12-03-2009, 11:33 AM   #1
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Rep: Reputation: 19
How to add mod_expires


I have been working on optimizing the speed of my sites. I'm finding that in order to "keep up" with the image on the web, I need to add Web 2.0 elements to add to the experience. However, this is having a negative impact on load times.

I'm using YSlow (Firebug addon) to analyze my sites. One suggestion is to add Expires Headders to images, css, js, etc.

I'm trying to find a clear way to install this and cannot seem to find anything so I come here. Can anyone please help me install this module?

I'm running DirectAdmin on the server.
 
Old 12-03-2009, 02:20 PM   #2
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
I don't know about DirectAdmin, but most places you just LoadModule the mod_expires module and read the docs. However, you need to be very clear, that once cached, you will have no way of changing your cached content. Caching can hurt you a lot if not done properly.
 
Old 12-03-2009, 02:26 PM   #3
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
I can't even fild the mod_expires.so module anywhere.

However... I was not aware that it makes things unchangable. I thought that I could set "modification plus 30 minutes" or something and then it would update every 30 minutes. Is this not correct?

If not, how would you suggest that I go about speeding up load times? I tried using some GZip plugins for Joomla but they seem to just make addition JS calls and the size downloaded actually increases.
 
Old 12-06-2009, 03:26 AM   #4
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
OK

OK, the story goes like this:

First you make sure, that with every change the URL changes. In case of uploaded material you add a build number to the URL for example. Like this:

http://static.yoursite.com/b1432/images/header.jpg

If something changes, you increment the build number. This makes sure, that if something changes, your clients really do get it. Also make sure, that your static domain is excluded from any cookies you may send.

Next, you enable mod_expires. In your case it may either be build into your Apache or you need to obtain it manually. If this is done, you can set a very long expiry.

Please read this site very, very carefully: http://developer.yahoo.com/performance/rules.html

Only enable mod_expires, if you are 100% sure everything goes according to plan. Preferable run a testing site where you publish 1 or 2 releases of your site changing some content so you make sure, nothing goes wrong.
 
Old 12-06-2009, 09:49 AM   #5
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
My sites are running Joomla. Is that a problem?

In addition, I have customers that have purchased some hosting from me so this would be server-wide. If I can mess up their sites, I better not do this.

Is there any other way that I can speed things up?
 
Old 12-06-2009, 01:48 PM   #6
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
O my...

I do absolutely _not_ recommend using mod_expires with _any_ CMS system not explicitly stating, that they have support for it.

You can, however speed things up by implementing opcode cache like APC, eAccelerator or Zend Optimizer. If you have many visitors, so that you don't have enough Apache processes (logs say so), you should have keep alives turned off.

Please note that Joomla never was a racing machine, performance would be mediocre at best and will never be any better due to the flexible design. Flexibility and performance don't go together, you have to accept trade-offs in one or the other.

A little sidenote, please don't take offence: I don't know how good you are at Linux but knowing the questions you asked I would not entrust you with my website. You should consider disbanding your server and host with a professional company who has qualified staff to do operate their services.

Last edited by janoszen; 12-06-2009 at 01:50 PM.
 
Old 12-06-2009, 02:21 PM   #7
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Thanks for the vote of confidence!

I don't understand how wanting to optimize a server leads you to believe that I am fully inexperienced. My host helps me with the managed services. However, if I ask them to do everything, then I will never learn it for myself. I'm now trying to better my knowledge when it comes to servers and server performance, I figured that is a good thing. I do have Zend Optimizer running already, but I was hoping to give it a little more pep and I don't believe that things can't be optimized further. There is always room for improvement.
 
Old 12-06-2009, 03:21 PM   #8
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Optimization

It's not the optimisation I would be worried about but the fact that you use a ready-made admin panel without the skills to truly manage your server by hand (eg. obtaining and installing a module, reverse engineering a distro package if you must). Not speaking of mod_expires, which could have caused you a flood wave of headaches had you been able to blindly install and enable it. Imagine what would have happened if your regular visitors' browsers had cached your main page for a year or so...

I really didn't want to be offensive, it was meant to be a friendly advice. Day by day I see people trying to run their own hosting services. Trying and failing. I spent my last year implementing a really secure and compatible hosting service with admin panel, etc, etc and believe me, if you want to do it right, it's a daunting task.

As to your service, as long as you only have a few (10-20-30) people / sites using it, you should be fine. Above that you should really give it some serious thought. Admin panels are cool and all that up to the point they fail. At that point you're in a world of hurt and you'll have a crash course in Apache debugging on your hands if the timing suits you or not.

Anecdote: Back a few years ago when I started with Linux, I had a hardware failure and I needed to reinstall everything. Fortunately I already had a year of thin experience in managing my hobby server, but it still took me a 48 hour weekend without any sleep to get things fixed.
 
Old 12-07-2009, 09:02 AM   #9
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
I do appreciate the advice, and I didn't take offence to it. Sometimes, it just seems that there are a lot of people that say "hire someone" or "let a professional do it". But, if that was the case, I wouldn't have joined a forum to learn how to do things properly -- Everyone starts somewhere.

First, the sites that I host are friends and family. Not that it means that they aren't important but when they get help from me on things, they need to be a little more understanding.

Also... I have had my shared of re-installing the OS. The reason why I have a panel is not because I can't do the manual changes but because it is simpler and quicker to be able to use the panel. I do know how to blindly install modules, compile programs, etc. I never do anything without getting some input first because I don't want to mess anything up. Although I said "I'm trying to find a way to install mod_expires", I was trying to figure out more about it in general (which you helped with -- thank you). Even after I found the method of installing it, I would have been posting another message getting some input from the more experienced users here.

I do appreciate the input that you have provided, and I am glad that I didn't just install it. I did have a couple of guides on how to install it. I just wanted to know more at this point.
 
Old 12-07-2009, 05:03 PM   #10
janoszen
Member
 
Registered: Oct 2009
Location: Budapest
Distribution: Mostly Gentoo, sometimes Debian/(K)Ubuntu
Posts: 143

Rep: Reputation: 22
Deflate

Issue closed then. Glad it helped. I gave it some thought. If you want to trade some CPU cycles for bandwidth (and speed) try mod_deflate. No negative side effects.
 
Old 12-22-2009, 07:01 PM   #11
jephstange
LQ Newbie
 
Registered: Dec 2009
Posts: 1

Rep: Reputation: 0
I have to put my two cents into this conversation. jim.thornton don't listen to janoszen's advice. If everyone was to not learn for themselves, and strive to learn and do great things, we would live in a socialistic society. The world needs entrepreneurs to do things that 99 percent of people can't. Great companies have been started in garages, with little knowledge, and over time you gain all the knowledge needed and own a corporate building. His question was not about if he should stay in business, but rather about mod_expires. I am appalled at your negativity.
 
Old 12-22-2009, 08:03 PM   #12
jim.thornton
Member
 
Registered: May 2007
Posts: 430

Original Poster
Rep: Reputation: 19
Thank you for the support. Much appreciated.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
What should I add into my xorg.conf file to add a resolution? gannggstaz Linux - Desktop 2 09-30-2009 06:06 PM
What's package daemon that add to /etc/fstab when you add USB sticks frenchn00b Linux - General 3 01-20-2008 08:30 PM
kdevelop add folder and add new class is slow edwardt Programming 0 03-03-2004 06:04 PM
Cant add MySQL through add/remove programs Hero Doug Fedora 6 01-03-2004 10:35 PM
Miss Match IP Add and Adapter Add. ???? hitesh_linux Linux - Networking 5 02-08-2003 01:34 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration