Jump to content

cache settings in development


Recommended Posts

When I do code changes, they are not displayed in the browser. Only when I change a content in the editor (for example a heading), save, clear the cache, the code changes will be displayed.
Is this normal? A wrong cache setting in the development?

Link to post
Share on other sites

What kind of cache are you running?

  • Template Cache
  • ProCache
  • WireCache

In my opinion caching should be disabled during heavy development. Activate it for testing purposes only.

ProCache and Template Cache are both capable of such kind of caching you described. Even custom WireCache if done right/wrong. So... yes, it's normal in most cases.

For testing any development progress you should be logged into ProcessWire admin to have an active session - makes life much easier at least in the frontend.

 

  • Like 2
Link to post
Share on other sites

For the front-end, I use the header meta cache directives to disable the browser cache during development. I can comment them out to test caching See this link for more info.

  • Like 2
Link to post
Share on other sites

So... you didn't activate or use any kind of cache?

Then @ricks solution might work for you.

Another thing... are you using Opera? That thing annoys me with cache issues each and every time I use it.

Link to post
Share on other sites

Maybe some sort of server cache layer?  Are you working local or on a server? Last but not least, the cache on your developer tools. 

Link to post
Share on other sites

@elabx

I run localhost:8888 with MAMP (Mac). I don't use developer tools, it is a simple PW blank installation.

Link to post
Share on other sites
1 hour ago, kaz said:

I run localhost:8888 with MAMP (Mac)

Unless things changed lately, MAMP activates OPCache by default. Make sure that the following settings are the same in your php.ini:

opcache.validate_timestamps     = true
opcache.revalidate_freq         = 0

Also check in MAMP config settings if caching is enabled for PHP (not sure if that option is still there, but with PHP 5.5, you could enable frontend caching).

  • Like 2
Link to post
Share on other sites

@BitPoet

I activated the lines in php.ini (php7.4.12), they were commented:

opcache.validate_timestamps=1
opcache.revalidate_freq=0

Settings: Cache was "off", I changed it to "OPcache", due to the change in php.ini

Unfortunately nothing changed. Changes will only be visible after a "save" in the editor.

I have installed a module, Cache Control. Even "clear all" makes no difference in the frontend. I guess I have to live with it.

Link to post
Share on other sites
7 hours ago, kaz said:

Unfortunately nothing changed. Changes will only be visible after a "save" in the editor.

I'm not understanding this statement. Of course nothing you changed will be reflected until you save those changes.

You edit existing content.
Save those edits.
Refresh the browser.

Am I misunderstanding your goal?

Link to post
Share on other sites

@rick

I meant code (css, php, …) changes, not content.
For example, if I try a change in the footer:
<footer class="bgcolor-secondary">
to
<section class="bgcolor-primary">
Nothing changed in the source code of the browser, in Safari, Chrome and Firefox. I clear the cache, no change, I restart the browser, no change.

I have used MAMP and MAMP Pro (demo). Because I couldn't find a better idea, I have deleted MAMP / Pro from the Mac, and installed XAMPP. I previously saved the layout with ProcessExportProfile. Then I reinstalled Processwire with that profile, and yes, now I see changes when I refresh the browser via cmd + r, it works!
I don't know why it behaved this way in MAMP, I worked with MAMP many years ago with ver. 1+2, I haven't used it since. In XAMPP it works now, so I simply forget about the problems with MAMP.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...