Ask Your Question
0

What is the reason that CSS or JS are not being cached while working on Laravel locally?

asked 2022-07-14 11:00:00 +0000

pufferfish gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-10-24 11:00:00 +0000

lakamha gravatar image

There could be several reasons why CSS or JS files are not being cached while working on Laravel locally:

  1. Browser cache settings: The browser may be configured to not cache files while in development mode. The cache can be cleared by refreshing the page with a hard reload (Ctrl+Shift+R).

  2. Laravel configuration: Laravel may have caching disabled for development environments. In the config/cache.php file, check that the default cache driver is set to file or array.

  3. Middleware or routing: Middleware or routing may be preventing the caching of files. Check that there are no middleware or routes that are modifying cache headers or responses.

  4. File permissions: The cache directory or files may not have the correct permissions, preventing the web server from writing or reading them.

  5. Development tools: Development tools may be configured to always load the most current version of files. Check if there are any development tools, such as BrowserSync or LiveReload, that are reloading files on change.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-07-14 11:00:00 +0000

Seen: 15 times

Last updated: Oct 24 '21