Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mvnobrega's avatar

how to remove app.js from the cache?

I have already contacted the support of my hosting service believing that the problem was with them, but everything indicates that the laravel itself is creating a cached app.js file.

I had to rename the file for the code changes to take effect on the website.

For example, if you enter this link: https://www.meempi.com/js/app.js

You will see that the app.js file is displayed, but it no longer exists, it has been deleted.

For every adjustment I make to the code, I need to rename the file. Is the laravel really doing this?

How do I solve it?

0 likes
7 replies
Sinnbeck's avatar

I get a 404 currently?

And rename it? How do you rename it if it does not exist?

Or do you mean that it is loading an old version? If so then that it your browser, not laravel. Use cache busting

1 like
mvnobrega's avatar

Strange, because I clear the browser's cache, tested it on other devices and cell phones, and even in anonymous mode the file is displayed

I change the code and rename it, so the old one ceases to exist.

Sinnbeck's avatar

How do you change the code? What do you do to "fix" it exactly. You upload and the file suddenly appears? And then you delete it?

mvnobrega's avatar

I do not upload, just change what I need and save directly to the hosting. Then just rename

Sinnbeck's avatar

Do you run npm run prod or similar?

And how do you change those files? Do you have a program that automatically ftp changes to the server? Please spend a few minutes describing how your work flow is. It is really hard guessing where the error lies when we have to guess

Laravel does not "cache" the file, but it has ways of building it (like the command above)

mvnobrega's avatar

Yes, I use npm run prod on my personal computer. Then, I access the app.js file on my personal computer and copy the code (ctrl + c), go to the hosting service, click on edit the app.js file and paste (ctrl + v) my new code.

Then I save. But when I enter the site the change does not occur, so I need to rename the app.js file, and finally everything works again.

Please or to participate in this conversation.