Working with htaccess is a new capitol for me. I have already read about mod_expires here https://httpd.apache.org/docs/current/mod/mod_expires.htm, but I’m stil confused.
I have the next code from stack overflow:
My questions are:
I suppose the line
ExpiresByType image/jpg "access 1 year"tells the client (browser) to download the file and keep it for one year. And when the client accesses the same page from my website, the jpg image won’t be downloaded from my website. It will be read from his computer (where the browser saved first time). After one year, the browser automatically deletes the file and, once the client access my website, it will download again, for another year. If the client cleans his browser history after 2 months, then the browser will download it again even if a year hasn’t passed. Do I miss something ?
What cache availability should I set for each file type ? It depends on the file ? What should I consider when set the expiration time ?
What’s the difference between
"access 1 year"and
"access plus 1 year"?
ExpiresDefaultrule works for
phpfiles too ? I mean, if I have a contact.php file with some content and I modify the content of contact.php, because of
ExpiresDefaultrule, the content won’t change to the user ?
Do search engine spiders listen for this cache rules or they download the files each time they crawling my website ?
Is it true that
ExpiresDefaultis for the files I don’t set using
ExpiresByType? If the answer is yes, what are the other types ? What types of files are included here ?
Do I understand correct that
Header set Cache-Control "max-age=290304000, public"is the maximum time allowed for a file to be cached ? If the answer is yes, then means that
"access 999 years"will take no effect as long
290304000is the limit. True or false ?