Title: Set Cache Directory
Last modified: August 30, 2016

---

# Set Cache Directory

 *  [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/set-cache-directory/)
 * Hi Mike,
 * Thanks for the awesome plugin – it’s been a life saver 🙂
 * I was hoping to move the cache directory, so that it resides with all my other
   caches / temporary site files (vs within the /plugins directory, amongst code).
   I can see that the path is hardcoded (si-captcha.php, line 1241).
 * My hope was that “Enable PHP sessions” would prevent this cache directory from
   being used (i.e. temp data would be stored in sessions), but that appears not
   to be the case – it continues to be populated.
 * Could I request a setting to change the cache directory – or at least, a filter
   so that I can override it in code (without needing to edit the plugin)?
 * Thanks much in advance! 🙂
    Justin
 * [https://wordpress.org/plugins/si-captcha-for-wordpress/](https://wordpress.org/plugins/si-captcha-for-wordpress/)

Viewing 10 replies - 1 through 10 (of 10 total)

 *  [mbrsolution](https://wordpress.org/support/users/mbrsolution/)
 * (@mbrsolution)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6759900)
 * Hi Justin thank you for your request. The plugin developer will investigate further
   your suggestion.
 * Regards
 *  Thread Starter [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6759901)
 * Great, thanks, I’ll be keeping my eye out for it.
 *  [joe-fwmedia](https://wordpress.org/support/users/joe-fwmedia/)
 * (@joe-fwmedia)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6759994)
 * I agree, this is a very good plugin and my clients swear by it.
 * My only issue is the location of the cache directory — it gives me all kinds 
   of headaches because of strict permissions we use in our environment. An “si-
   captcha-cache” directory somewhere under “uploads” would work much better for
   me but the sorts of overrides that the OP suggested would also be awesome.
 * Thanks!
 *  Thread Starter [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6759998)
 * Yeah, I was just gonna reach out to the author again too – since two updates 
   have been posted & 3 months elapsed since I mentioned this. Would it help if 
   I provided a patch? Should be an *extremely* quick 1-liner to just add a filter.
 * Thanks again
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6759999)
 * it is technically a challenge to do this since the php file that displays the
   image runs separate from the wordpress environment.
 * I can look at this issue though
 * > My hope was that “Enable PHP sessions” would prevent this cache directory from
   > being used (i.e. temp data would be stored in sessions), but that appears not
   > to be the case – it continues to be populated.
 *  Thread Starter [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6760000)
 * Sure, that would be equivalently good 🙂 As long as the plugin doesn’t write 
   files to a hard-coded location.
 * Thanks!
 *  Thread Starter [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6760004)
 * Does it look likely to happen at any point…? Is there maybe some temporary hack/
   modification I could do in my own copy? I really really love this plugin, but
   the constant appearance of those files in my plugins directory remains an issue
   essentially every time I push/pull my site…. :/
 *  [Mike Challis](https://wordpress.org/support/users/mikechallis/)
 * (@mikechallis)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6760005)
 * About the setting “Enable PHP sessions”
 * Enable this setting to use PHP sessions for the CAPTCHA. PHP Sessions must be
   supported by your web host or there may be session errors.
 * When the setting is not enabled it writes temporary php files to this folder
   
   wp-content/plugins/si-captcha-for-wordpress/captcha/cache
 * I did some testing and have determined that the setting “Enable PHP sessions”
   is working properly. When you have the check box enabled, it will not use the
   cache directory.
 * Note: if you have a page cache plugin: after you change this setting, empty the
   page cache
 *  Thread Starter [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/set-cache-directory/#post-6760006)
 * With the PHP sessions option disabled, new files appear in the cache directory
   each time a captcha is ‘generated’ (i.e. by reading a post while not logged in,
   or by manually refreshing the existing captcha). This is as I’d expect.
 * If I enable the PHP sessions option, I don’t see these files predictably appearing–
   i.e. I can refresh the captcha image numerous times without dir populating (as
   desired). However, the issue is that the dir *does* still seem to populate eventually–
   albeit much more slowly. For instance, if I leave that option enabled then check
   the cache dir 15 minutes later, one or two files have indeed appeared. I can’t
   make them appear explicitly by refreshing the image (as when the option is disabled)–
   but they do still appear from time to time.
 * Thoughts? I don’t have any caching plugins on my site.
 *  Thread Starter [JK](https://wordpress.org/support/users/justin_k/)
 * (@justin_k)
 * [10 years ago](https://wordpress.org/support/topic/set-cache-directory/#post-6760015)
 * …Should I just assume this plugin isn’t being supported anymore? Been hoping 
   to resolve this for a full 6 months, but it seems like trying to have a dialog
   isn’t really fruitful…

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Set Cache Directory’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/si-captcha-for-wordpress_dde4c1.svg)
 * [SI CAPTCHA Anti-Spam](https://wordpress.org/plugins/si-captcha-for-wordpress/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/si-captcha-for-wordpress/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/si-captcha-for-wordpress/)
 * [Active Topics](https://wordpress.org/support/plugin/si-captcha-for-wordpress/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/si-captcha-for-wordpress/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/si-captcha-for-wordpress/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [JK](https://wordpress.org/support/users/justin_k/)
 * Last activity: [10 years ago](https://wordpress.org/support/topic/set-cache-directory/#post-6760015)
 * Status: not resolved