We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37165
    • 89 Posts
    I'm using revolution 2.4.0 and the latest version of migxdb. I have a large database of artwork that is called by two templates. One template is ajax based and randomly loads three items from the db. This works fine. I have another template that searches TV values in the db and returns results. Anywhere from a couple to maybe a hundred in extreme cases. The problem I'm having is that any page that has the later template applied loads painfully slow the first time. As in minuets not seconds. However once the page has been triggered once, it loads quickly each additional time even after clearing images out of the browser cache.

    I have over 50 different pages with this template. It's just not practical for me to open and load each page everytime I save something. After doing some research I tried using the Refresh Cache plug-in. It worked, pages loaded super fast, but I found that roughly a third of my images didn't load after running the plug-in. If I used the regular modx clear cache they all loaded fine, but pages were slow. I also tried doing just a CRON script on the server, but this had the same result as the refresh cache plug-in.

    I've also tried calling my snippet uncached, but that doesn't seem to make a difference. Code is below. If anyone has any ideas, I'd be very grateful.

    Here is the template that is causing problems:


    [[$header]]
    
    	<body class="closedIntro">
    		
    	
    		
    		<section class="black wholeScreen artWrapOpen" id="artWrap">
    			
    			
    			[[$headerMenu]]		
    				
    			<div class="artContainer" >
    				
    			<div class="masonryWrap">
    	
    			[[!migxLoopCollection?
    						  &packageName=`artGallery`
    						  &classname=`artGallery`
    						  &tpl=`galleryTemplateArchive`
    						  &totalVar=`total`
    						  &limit=`500`
    						  &offset=`0`
    						  &where=`{"1":[
    									    {"[[*filter]]":"[[*alias]]"},
    									    {"OR:[[*filter]]:LIKE":"%||[[*alias]]||%"},
    									    {"OR:[[*filter]]:LIKE":"[[*alias]]||%"},
    									    {"OR:[[*filter]]:LIKE":"%||[[*alias]]"}
    									]}`
    						  
    			]]	
    			
    			</div>
    			
    
    			</div><!--close artContainer -->
    		
    				
    				
    			</section><!-- close artWrap -->	
    		
    		[[$footerMenu]]	
    		
    		[[$searchPage]]
    
    		[[$contactPage]]
    
    	
    [[$footer]]
    
    


    and here is the template chunk that goes with it:

    				<div class="item"  id="lb-[[!randomNumber]]">
    	
    				<img src="[[!phpthumbof? &input=`assets/uploads/[[+image]]` &options=`&h=200&aoe=1&zc=0&q=100`]]" height="495" alt="[[+title]]" />
    								
    	
    			</div><!-- close item-->
    
    		<section class="white lightbox lb-[[!randomNumber]]">
    
    				<div class="headerStyle white" id="closeRow">
    		
    					<div><a>X</a></div>
    		
    					<div><a>Close</a></div>
    		
    				</div>
    				
    				<div class="artTitleWrapper">
    		
    					<div class="imageContainer">
    			
    						<img class="lazy"  src="[[!phpthumbof? &input=`assets/uploads/[[+image]]` &options=`&h=800&aoe=1&zc=0&q=100`]]" alt="[[+title]]">
    					
    					</div>
    			
    					<div class="relatedElements">
    				
    						<div class="title">[[+title]]</div>
    				
    						<div class="materials">[[+materials]]</div>
    					
    						<div class="relatedGalleries">Related Galleries</div>	
    				
    						<ul>
    							
    							<li class="archiveButton" id="[[+year]]"><a href="[[+year]].html">[[+year]]</a></li>
    							
    							[[loopDelimited? &value=`[[+project]]` &delimiter=`||` &tpl=`galleryRelatedListTemplate`]]
    							
    							[[loopDelimited? &value=`[[+color]]` &delimiter=`||` &tpl=`galleryRelatedListTemplate`]]
    							
    							[[loopDelimited? &value=`[[+media]]` &delimiter=`||` &tpl=`galleryRelatedListTemplate`]]
    
    											
    						</ul>
    						
    					</div><!-- close related elements-->
    				
    				</div><!-- close artTitleWrapper-->	
    
    
    		</section>	<!-- close section-->