0

i tried google and found one solution at 'https://webmasters.stackexchange.com/questions/24881/cache-a-particular-image-using-htaccess' but it cache all the file of folder, i want to cache only particular file from folder. please help me

Thanks in advance.

JK Patel
  • 103
  • 5

1 Answers1

1

In .htaccess you can only cache all files from a certain extension like jpg.

To cache a directory you have to specify each file within the directory in a manifest file which is linked to your html page.

Your html would look like this:

<!DOCTYPE html>
<html manifest="manifest.appcache">
  <body>
  ...
  </body>
</html>

Note: This is only supported in html5

Create a file called manifest.appcache in the directory from the html page.

This should be the content of the file:

CACHE MANIFEST
/theme.css
/logo.gif
/main.js