I have seen:
ExpiresByType image/jpg "access 1 year"
But also:
ExpiresByType image/jpg "access plus 1 year"
So, what's the difference between those two lines ?
These two directives are the same.
The plus
keyword is entirely optional. It is just syntactic sugar, to make it (arguably) more "readable".
As stated in the Apache docs for mod_expires:
ExpiresByType type/encoding "base[plus num type] [num type] ..."
:
Theplus
keyword is optional.
So, include it or not - it is up to you. But, as with everything, it is important to be consistent. Include it OR don't include it; don't mix it.
Aside:
ExpiresByType image/jpg "access 1 year"
As I noted in my answer to your other question, you should probably be using image/jpeg
here, not image/jpg
.
The plus keyword is optional
". In my opinion optional
doesn't mean same effect
. For me it means that using it you will get this
, not using it you will get this
. That's why I was confused.
plus
keyword is literally just optional, as in "throw-away" optional. And not "optional" as in an "optional parameter". This alternative syntax is simply for readability, so the additional adjective just makes it read more naturally. (The "normal" syntax is a bit more cryptic and is "rarely" used, but is more machine friendly, eg. ExpiresByType image/jpeg A31536000
.)