Block view.css caching problem
Permalink
Hello,
i'm probably not the first with this problem, but instead of being productive this afternoon i've been pulling my hair out... an did not find a solution yet
i have made an override for the search block and made a custom template for it.
At first i put my css code in my theme's main.css, but the changes i made there did not get refreshed, the server keeps serving me a cached version: main.css?v=2345... is what i've got from chrome developers tools.
After reading some forum posts i found it would be a better way to put the block css into the view.css, so i did that. At first the css got loaded but after that i got the same caching problem.
location files:
root
-
blocks
-
search
-
templates
controller.php
-
mysearchtemplate
-
view.css
view.php
I tried the same with a custom block i've made in the past and put some css in the view.css of that block, every time i change something in that file the changes reflect after a refresh, i don't understand the difference?
location files custom block:
root
-
blocks
-
mycustomblock
-
view.css
view.php
controller.php
....other files
The only way i found to force the new version with the problematic view.css is to remove that file, refresh the page and put the file back in place and refresh the page again. This is not very efficient :(
what i've done so far:
Cache and speed settings: turned everything off
browser cache: emptied and turned off
used different browsers: chrome and Safari
in my overridden search block controller file added:
in the past i did not have any problems with reflecting changes in my main.css? i assume thats where my problem starts?
i'm using 5.6.2.1
can anyone shed some light on this please
thank you
Gr Marco
i'm probably not the first with this problem, but instead of being productive this afternoon i've been pulling my hair out... an did not find a solution yet
i have made an override for the search block and made a custom template for it.
At first i put my css code in my theme's main.css, but the changes i made there did not get refreshed, the server keeps serving me a cached version: main.css?v=2345... is what i've got from chrome developers tools.
After reading some forum posts i found it would be a better way to put the block css into the view.css, so i did that. At first the css got loaded but after that i got the same caching problem.
location files:
root
-
blocks
-
search
-
templates
controller.php
-
mysearchtemplate
-
view.css
view.php
I tried the same with a custom block i've made in the past and put some css in the view.css of that block, every time i change something in that file the changes reflect after a refresh, i don't understand the difference?
location files custom block:
root
-
blocks
-
mycustomblock
-
view.css
view.php
controller.php
....other files
The only way i found to force the new version with the problematic view.css is to remove that file, refresh the page and put the file back in place and refresh the page again. This is not very efficient :(
what i've done so far:
Cache and speed settings: turned everything off
browser cache: emptied and turned off
used different browsers: chrome and Safari
in my overridden search block controller file added:
<?php defined('C5_EXECUTE') or die("Access Denied."); class SearchBlockController extends Concrete5_Controller_Block_Search { protected $btCacheBlockRecord = false; protected $btCacheBlockOutput = false; protected $btCacheBlockOutputOnPost = false; protected $btCacheBlockOutputForRegisteredUsers = false; function view(){ //here is some code i need parent::view(); }//end view }//end class
in the past i did not have any problems with reflecting changes in my main.css? i assume thats where my problem starts?
i'm using 5.6.2.1
can anyone shed some light on this please
thank you
Gr Marco
I'm not sure if this helps or not, but you can't override the controller.php in a custom template. So that block is still probably getting cached even though it says that the cache is off. I would suggest moving that file up one directory so it's /blocks/search/controller.php this will affect all search blocks though.
Hello Hutman,
The controller.php is in the search folder, my folder listings above are not so clear, the second example was a custom block not related to the search block
Gr Marco
The controller.php is in the search folder, my folder listings above are not so clear, the second example was a custom block not related to the search block
Gr Marco
Did you ever find a solution to this?
Sorry, i can't remember exactly, i don't think the problem just went away, i think i changed my code to make the page list do what i wanted instead of the search block.