Topic: Disable server side cache

Is there a way to disable server side caching temporarily for development?
Its time consuming to delete the server side cache after every change in code

Re: Disable server side cache

Have a cron job clear the tmp folder where the cache gets stored or disable caching in the apache server config.

Refer:
http://bertanguven.com/disable-caching-of-assets-in-apache
https://stackoverflow.com/questions/11532636/how-to-prevent-http-file-caching-in-apache-httpd-mamp
https://gist.github.com/JamieMason/3245483

Re: Disable server side cache

Thanks apmuthu, that's a very good idea, i'll check those out tomorrow

4 (edited by poncho1234 11/02/2018 05:04:03 pm)

Re: Disable server side cache

Not for production

Whilst looking for something else I discovered there were already a few functions in FA that clear the cache

So added to renderer.php

If you want an icon:-

File: \themes\default\renderer.php
87:                 $dimg = "<img src='$path_to_root/themes/".user_theme()."/images/remove.png' style='width:14px;height:14px;border:0;vertical-align:middle;' alt='"._('Delete Cache')."'>&nbsp;&nbsp;";

Then add:-

File: \themes\default\renderer.php
097:                 function delete_company_cache(){
098:                     flush_dir(company_path().'/js_cache');
099:                 }
100:                 echo "<a class='shortcut' href='?delete_company_cache=true'>$dimg" . _("Delete Cache") . "</a>&nbsp;&nbsp;&nbsp;\n";
101:                 
102:                 if(isset($_GET['delete_company_cache'])){
103:                     delete_company_cache();
104:                 }

It does not disable cache, just clears cache just for the company you are logged on to when you want from any page

Re: Disable server side cache

@joe: can this be generically updated in the core?

Re: Disable server side cache

I will have a look into this.

Joe

7 (edited by poncho1234 11/03/2018 03:38:14 pm)

Re: Disable server side cache

@joe, @apmuthu, This is already in core - click the 'Update' button in 'Preferences'

The above mod just lets you do it in one click and stays on current page instead of three clicks (->Preferences click Update) and changing page to Preferences, then at least one click to return to the page you were on.

If you're making changes to css it saves a few clicks and time everytime you update

Re: Disable server side cache

@poncho1234: You are right - the company/#/js_cache/1/* vanishes.