I was checking the performance of my site on gtmatrix and found that Leverage browser caching is not well.They are showing that expiration date not specified to my css,js and images.For that i need to specify expiration date of them in .htaccess file.I read this but didn't understand how to make .htaccess file in java.My project is based on hibernate and i am using glassfish server.Could anybody tell me how to create .htaccess file in java.
Asked
Active
Viewed 1,842 times
0
-
Read up how to create files with Java, then creating a file named ".htaccess" will be only a specific case for your file creation example. – Smutje Aug 12 '14 at 06:55
-
@Smutje I know how to create files with java but i don't know which syntax to use in `.htaccess` files. – Fresher Aug 12 '14 at 06:58
-
Perhaps you could refer to http://stackoverflow.com/questions/15067719/controlling-cache-expirations?rq=1 – Smutje Aug 12 '14 at 07:00
-
@Smutje Just 1 question where should i place this file.I think where all my JSP pages are or somewhere else. – Fresher Aug 12 '14 at 07:02
-
@Smutje also when i am creating a `.htaccess` file it says you must specify file name. – Fresher Aug 12 '14 at 07:04
-
possible duplicate of [.htaccess not working apache-tomcat](http://stackoverflow.com/questions/10528552/htaccess-not-working-apache-tomcat) – Konstantin V. Salikhov Aug 12 '14 at 07:37
-
@KonstantinV.Salikhov I am using glassfish not apache tomcat – Fresher Aug 12 '14 at 10:23
-
There is no difference in your case. That answer answers your question too – Konstantin V. Salikhov Aug 12 '14 at 11:05
-
Here is exact duplicate if you wish http://stackoverflow.com/questions/9031079/analog-of-php-htaccess-for-jsp-glassfish – Konstantin V. Salikhov Aug 12 '14 at 11:06