What is the average cache time for static files?

Asked

Viewed 154 times

3

What is the average cache expiration time for poorly updated static files? There are techniques or recommendations that can help me to determine the expiration time?

An example would be:

www.apple.com/scripts/libs/
www.apple.com/css/libs/

I want all the files that are inside the directory /libs with a longer expiration time to improve the performance of my website.

Any hint or reference?

  • 2

    Apache? If yes, try this: http://answall.com/a/44178/3635

1 answer

2


Assuming you are using an apache server, you can refer to the Caching Guide (link), where some recommendations are found, such as this:

The default expiry period for cached entities is one hour, however this
can be easily over-ridden by using the CacheDefaultExpire directive. 
This default is only used when the original source of the content does not
specify an expire time or time of last modification.

That is, you may overwrite the recommendation, but you should be aware of the files that will determine a longer expiration - and analyze if the reason is worth it, otherwise you may compromise performance. In the cited documentation, there is a part that speaks 'What Can Be Cashed?', where you can see more details about what you will keep longer.

You should also take into account the MCacheMaxObjectCount (link), which determines the number of elements you will store in cash. It seems to make no sense, but at the time you will determine different average times for each file.

I know only one article that talks about different cache determination techniques, and you can consult it here. I hope you’ve been helpful.

  • 1

    Hello, @nessoila! Welcome to Sopt, I notice you’ve been struggling to answer a number of questions. A tip that could add value to your posts, would be at least a summary of the essential points of the recommended links (keeping the reference, of course), so that people do not depend too much on external sources (which, as you probably already know, may cease to exist at any time). If you are interested, it is worth a visit to http://meta.pt.stackoverflow.com, which is focused on the discussion about how the site works.

  • 1

    was the tip @Bacco :) I will read the complete recommendations of the link. can leave,

  • Thanks @nessoila, I will read this material, I found quite useful.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.