Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
A donation makes a contribution towards the costs, the time and effort that's going in this site and building.
Thank You! Steffen
Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
| |
|
Topic: How to configure mod_file_cache to cache multiple files |
|
Author |
|
kdc_blue
Joined: 04 May 2007 Posts: 2
|
Posted: Fri 04 May '07 16:59 Post subject: How to configure mod_file_cache to cache multiple files |
|
|
I need to configure mod_file_cache to recursively cache all files in a directory and its subdirectories on windows. Any idea on how to do it ?
Currently I am hardcoding all the files to be pre-cached when apache starts up which is a pain to maintain.
Example.
<IfModule file_cache_module>
CacheFile "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\assets\css\ab_bbar.css" "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\assets\js\ab.js"
</IfModule> |
|
Back to top |
|
tdonovan Moderator
Joined: 17 Dec 2005 Posts: 614 Location: Milford, MA, USA
|
Posted: Fri 04 May '07 19:39 Post subject: |
|
|
If you check the note in the Apache mod_file_cache docs, you will see that it says:
Quote: | Don't bother asking for a directive which recursively caches all the files in a directory. |
I guess they anticipated your question!
They suggest a way to accomplish this on Unix systems by creating an Include file using the find and sed programs.
A similar way to create this Include file on Windows would be to execute the following command from your web root directory: Code: | FOR /R %a IN (*.*) DO @echo CacheFile "%a" >> cachefiles.conf |
Then, move cachefiles.conf to your Apache \conf directory and Include it from httpd.conf.
If this works out for you, remember that you need to double the percent signs (i.e. %%a instead of %a) if you use this command inside a Windows .bat file.
-tom- |
|
Back to top |
|
kdc_blue
Joined: 04 May 2007 Posts: 2
|
Posted: Fri 04 May '07 22:35 Post subject: |
|
|
Thanks for your response. I will implement it and let you know how it works. |
|
Back to top |
|
|
|
|
|
|