Hi Friends,

I am facing a unique issue with the clear cache. The issue is coming in Drupal 7.53 project. When someone clear the cache from performance page then it removes some java script files from the DOM and UI is disturbed in absence of Javascript in the project.

To resolve this we have to open the module page and save it again. After that have to clean cache using drush (drush cc all) and then it starts workings with all JS loaded in the DOM.

I tried to fix this issue by adding the missing Javascript files in the hook_init forcefully but It was surprising for me. I found that now there is no need to save the modules page. Now it works by clearing the cache using drush (drush cc all). Means if cache is cleared from the perfomance page (admin/config/development/performance) then it is necessary to clear the cache using drush otherwise JS will not work well.

If cache is cleared from performance page or flush all cache then there are following errors comes in the console. Attached image (console-errors-after-system-clear-cache.png)

If I add the js forcefully in hook_init then there are some other errors in console (Image -console-error-after-applying-js-in-hook-init.png). I don't understand what is the difference between system clear cache and drush cc all. Using drush everything works.

I tried to find the difference between drush cc all and system clear cache but didn't do it exactly. Has someone faced this issue? What should I do to fix the same?

Comments

sunilsinghgaur created an issue. See original summary.

josh waihi’s picture

Category: Bug report » Support request
Priority: Critical » Minor
Status: Active » Closed (won't fix)

the Cache Debug module is about being able to trace where cache related calls are being made from. It appears that with your issue, you know exactly where the cache actions are occurring so I don't believe this module is relevant to your issue.

But to your issue, it would seem that the js you need is not being added after the cache is cleared. For example, drupal_add_js maybe called when you save the modules page but not when you view a general page. This would directly cause the issue you're experiencing.

Closing as this issue is out of scope of this project.