1

I'm running a standard debian apache2 web server.

Recently, I've noticed my load times slow down substantially. I've checked exactly which resources are taking a long time to load, and there are 2 or 3 files (scripts and images) that are taking around 30 seconds to load, when all others are taking less than 1 second.

I've checked out these slow resources on their own, and when requested individually, they are perfectly quick, they just slow down massively when loaded from the web page.

Why are some resources slowing down massively when with others, but are fine on their own?/How can I make these resources load faster?

ACarter
  • 111
  • 4

1 Answers1

1

Use caching on static resources, with mod_expires:

ExpiresByType text/html "access plus 1 month 15 days 2 hours"
ExpiresByType image/gif "modification plus 5 hours 3 minutes"
Marcel
  • 1,730
  • 10
  • 15
  • Thanks. From the point of a developer, is there any way to manually override this cache when developing? – ACarter Apr 29 '13 at 20:00
  • sure, just change the name of your resources, or include a versioning query_string. – Marcel Apr 29 '13 at 20:02
  • @ACarter You can disable caching in your browser. Furthermore I would be surprised if you couldn't trick Apache into using different configurations depending on where the request comes from. – Hauke Laging Apr 29 '13 at 20:56
  • Just realised this is standard client-size caching, so yeah, I can just disable the standard caching in by browser. (Ctrl-F5 in chrome) – ACarter Apr 30 '13 at 15:38