3

I am working on the css on a laravel server and I noticed that I have to restart MAMP (working on a Mavericks computer) every time I change even the smallest code for the new code to take effect. I know laravel caches their views, but on another computer running MAMP PRO, I do not have to restart MAMP PRO for the changes to take effect. On yet another computer running MAMP PRO I have the same problem I previously stated, which leads me to believe that I can fix the problem. How would I go about doing so?

jamespick
  • 1,974
  • 3
  • 23
  • 45
  • are you using an asset manager of some sort that minifies and/or concatenates your CSS? If yes, the caching is going on there, not in Laravel itself. Laravel itself does not cache these resources as they are not related to server side processing, only client side, where Laravel doesn't actually exist. – warspite Feb 11 '14 at 21:52
  • I am not using anything like that. – jamespick Feb 11 '14 at 22:06
  • I honestly don't know what can be happening. I edit my CSS all the time and haven't restarted my server in months. I don't even know how a server side PHP framework would cache client side CSS. Are you including your CSS into your `Blade` templates using `{{ HTML::style('url') }}` ? – warspite Feb 12 '14 at 02:44
  • No I am doing – jamespick Feb 13 '14 at 14:52
  • Is there any chance that the client is caching it? Have you tried not restarting the server and just clearing your cache, or perhaps using a different computer? – snollygolly Feb 13 '14 at 18:56
  • Well, as I said on another computer it works fine. The one that doesnt work is a MacBook Air with MAMP and the one that does work is a MacBook Pro with Retina display with MAMP Pro. Both computers are using the latest chrome and Laravel 4.1. – jamespick Feb 13 '14 at 21:23

1 Answers1

2

Get the version of php you use from the MAMP preferences pane.

Now, you want to edit your php.ini file for that version, and then restart MAMP.

The reason it is caching is because some versions of MAMP by default turn on OPCache.

sudo nano /Applications/MAMP/bin/php/[php-version]/conf/php.ini

Then, look for OPCache towards the end of the php.ini file, and comment out everything relating to it.

elliotanderson
  • 442
  • 4
  • 14