0

I have 2 Drupal7 application, both is having the same code. Both application is connecting to 1 database and 1 file storage which is a separate folder/directory. My problem is when I save/edit/delete something on the other application, the other application is not updated not unless I clear its cache. What will I do in order for the updates to reflect immediately in both application without clearing the cache?

  • What caching technologies are you using ? are you using memcache or some caching modules ? Do you want to keep caching your pages or you prefer to not have cache at all ? – 113408 Aug 22 '17 at 3:03
  • Hi, I am using filecache. Everytime I am doing a save/edit/delete, I need to clear cache in the other application. Steps in clearing cache is Administration > Configuration > Development > Performance -> Clear Cache. I prefer to remove/disable caching, but I dont know if it is okay or it can cause an impact to the applications performance. – Chad Aug 22 '17 at 5:35
  • Since you don't have memcache, and both your web servers are connected to the same DB, I don't see how it's possible to keep the cache. Do you Varnish in front of your web servers ? – 113408 Aug 22 '17 at 6:10
  • It is not really recommended to share data between sites like this, for exactly this reason (and probably many more). Have a look at Running two Drupal sites off the same database: Is it possible?. The Domain module might be useful to share data across multiple sites better. If you go this route, you should make sure that you invalidate the right caches on the other site once an entity is modified. – Neograph734 Aug 22 '17 at 6:10
  • Hi @113408, will I replace filecache with memcache to achieve my goal? – Chad Aug 23 '17 at 7:23
0

By looking at the filecache module description:

This module allows Drupal cache bins to be stored in files instead of storing in database.

This means that the data is stored in a folder and I guess this folder is not shared between your web servers.

I think you have 3 options:

  1. (easy solution) Disable Filecache and rely on the builtin cache of drupal. This will store the bins content on your database and it will be shared/invalidated for your two servers as they share the same DB
  2. (best solution) Replace FileCache with another caching module as Memcache or Redis. Depending on your server you might want to run those in a separate virtual machine and link them back to your web servers.
  3. Share the folder used by FileCache across your servers.

Hope this helps.

  • Hi @113408, Thank you very much for your help. I will try to implement those 3 options and decide later what best solution is. – Chad Aug 23 '17 at 9:19
  • @Chad If my answer helped you solve your issue, please mark it as solved. – 113408 Sep 1 '17 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.