logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

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.
Post new topic   Forum Index -> Third-party Modules View previous topic :: View next topic
Reply to topic   Topic: How to configure mod_file_cache to cache multiple files
Author
kdc_blue



Joined: 04 May 2007
Posts: 2

PostPosted: Fri 04 May '07 16:59    Post subject: How to configure mod_file_cache to cache multiple files Reply with quote

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: 611
Location: Milford, MA, USA

PostPosted: Fri 04 May '07 19:39    Post subject: Reply with quote

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

PostPosted: Fri 04 May '07 22:35    Post subject: Reply with quote

Thanks for your response. I will implement it and let you know how it works.
Back to top


Reply to topic   Topic: How to configure mod_file_cache to cache multiple files View previous topic :: View next topic
Post new topic   Forum Index -> Third-party Modules