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 ?– 113408Commented Aug 22, 2017 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.– ChadCommented Aug 22, 2017 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 ?– 113408Commented Aug 22, 2017 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.– Neograph734Commented Aug 22, 2017 at 6:10
-
Hi @113408, will I replace filecache with memcache to achieve my goal?– ChadCommented Aug 23, 2017 at 7:23
|
Show 1 more comment
1 Answer
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:
- (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
- (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.
- Share the folder used by FileCache across your servers.
Hope this helps.