Forums / Developer / Cache problem

Cache problem

Author Message

Sébastien Morel

Monday 26 March 2007 9:04:20 am

Hello,

The context is :

I have a classe : article, this class have differents attributes in particular a "objects relations".
The contributors can add differents objects to a article with this datatype.

This is the view_full article :

<div id="contenu">
	bla bla bla.......
	{include uri="design:outils.tpl"}
</div>
<div id="annexes">
	{include uri='design:objects_relations.tpl'}			
</div>

objects_relations.tpl :

{if is_set($node.data_map.relation_objects)}
	{foreach $node.data_map.relation_objects.content.relation_list as $relation}
			{let obj=fetch('content', 'object',hash('object_id', $relation.contentobject_id))}
				{content_view_gui view=line content_object=$obj}	
			{/let}
	{/foreach}
{/if}

and the view_line of the object :

{attribute_view_gui attribute=$object.data_map.body}
{if $object.data_map.keywords.content.keywords|contains('mykeywords')}
		{include uri='design:create.tpl'}
{/if}

create.tpl :

{set-block scope=root variable=cache_ttl}0{/set-block}
{let 
	user=fetch('user', 'current_user')
	myspecificnode=fetch('content','node',hash('node_id',ezini( 'NoeudsImportants', 'myspecificnode', 'oseo.ini' )))
}
	{if $user.is_logged_in}
		{let 
		
			access=fetch( 'content', 'list_count', hash( 'parent_node_id', $myspecificnode.node_id ) )
			myrub=fetch('content', 'list', hash('parent_node_id', ezini( 'Datas', 'nodeId', 'myspecificnode.ini' ))).0
			infosInvestisseurs=fetch('content','list',hash(
														'parent_node_id',$myrub.node_id,
														'limit',1,
														'class_filter_type',  'include',
														'class_filter_array', array( 'infos_investisseur' )
													)
								)
			$number=$infosInvestisseurs|count()	
		}
        	{cache-block keys=array($user.contentobject_id,$access,$number)}
        		{if $access|gt(0)}
					link to the section 
				{else}
					{let 
						
						}
						{if is_set($infosInvestisseurs.0)}
							link to edition of an objet
						{elseif $myrub.node_id|gt(0)}
							form for the creation of an object
						{/if}
					{/let}
				{/if}
			{/cache-block}
		{/let}
	{else}		
			link to login
	{/if}
{/let}

So, when I desactivate the cache everything is OK, but on the production plateform, the cache is activated and nothing works.

The test of the user logged_in works everytime, but the cache block bloc doesn't work.
In fact, I could believe it works because the array the everytime the same as the first generation of the cache but it shoudln't !!!

Ex: My User is logged_in, he is in a group which are not the right to access at the section. I add a location to my user in a group which have the right... and my user havn't the right.

Or, if my user have create a content, I want to create a link to the edit page of this content but the link is always a creation button, like if the cache was show....

I don't understand,I think is complicated to explain my problem but If you can help me I will be very happy !

Thanks

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

Sébastien Morel

Monday 26 March 2007 9:31:37 am

I try to simplify but when the cache is activate, I add a location to my user, I deconnect this user, and my template show the bad link, he show the link in the cache....

But the right is ok, If i go in the section I have the right... but my template is not correct...

.... :(

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

eZ debug

Timing: Jan 21 2025 17:21:06
Script start
Timing: Jan 21 2025 17:21:06
Module start 'content'
Timing: Jan 21 2025 17:21:06
Module end 'content'
Timing: Jan 21 2025 17:21:06
Script end

Main resources:

Total runtime0.1882 sec
Peak memory usage2,048.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 587.5781180.8516
Module start 'content' 0.00830.0062 768.429797.9375
Module end 'content' 0.01450.1737 866.3672533.2109
Script end 0.1881  1,399.5781 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00392.0675200.0002
Check MTime0.00140.7700200.0001
Mysql Total
Database connection0.00140.724810.0014
Mysqli_queries0.132070.12521410.0009
Looping result0.00150.78131390.0000
Template Total0.173292.010.1732
Template load0.00100.516510.0010
Template processing0.172291.513110.1722
Override
Cache load0.00070.364010.0007
Sytem overhead
Fetch class attribute can translate value0.00100.519710.0010
XML
Image XML parsing0.00030.143510.0003
General
dbfile0.00743.9109200.0004
String conversion0.00000.004130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs