• Resolved nando4

    (@nando4)


    LiteSpeed Cache Settings -> Default Public TTL value greater than 30 seconds

    vs

    LiteSpeed Cache Settings -> Default Private TTL value range 60-360 seconds (max=1hr)

    For logged-in users who receive private cache, the pages served can have a max TTL of 1hr set via the Litespeed Cache Settings -> Cache admin menu

    Just above it, the Public TTL accepts values greater than 30sec so can be 8 weeks if you like.

    It seems strange that logged-in users experience worse performance by having the server re-cache pages at least once every hour, adding delay for logged-in user receiving the page as well as loading the server. A waste of resources. In my case, these are static content pages with a ESI block navbar (TTL=0) with their avatar.

    Why not allow private cache TTL to be able to be set without limit the 1hr arbitrary limit like public cache?

    I modifed tpl\cache\settings-ttl.tpl.php with boldfaced line allow much the same much longer Private TTL like Public TTL, set it to 8 weeks, waited an hour and 1min and confirm my server is serving cached pages with the TTL greater than 1hr to logged-in users set, so less unnecessary server load.

    Unless I am missing some underlying reason for this 1hr maximum private TTL, pls consider adjusting the official LS plugin release to allow private cache ttl be unlimited in the same manner as public cache. It would mean I don’t need to manually modify the code to do and my server appreciates the reduced unnecessary load.

    <table class="wp-list-table striped litespeed-table"><tbody>
    
    	<tr>
    		<th>
    			<?php $id = Base::O_CACHE_TTL_PUB ; ?>
    			<?php $this->title( $id ) ; ?>
    		</th>
    		<td>
    			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
    			<div class="litespeed-desc">
    				<?php echo __('Specify how long, in seconds, public pages are cached.', 'litespeed-cache'); ?>
    				<?php $this->recommended( $id ) ; ?>
    				<?php $this->_validate_ttl( $id, 30 ) ; ?>
    			</div>
    		</td>
    	</tr>
    
    	<tr>
    		<th>
    			<?php $id = Base::O_CACHE_TTL_PRIV ; ?>
    			<?php $this->title( $id ) ; ?>
    		</th>
    		<td>
    			<?php $this->build_input( $id ) ; ?> <?php $this->readable_seconds() ; ?>
    			<div class="litespeed-desc">
    				<?php echo __( 'Specify how long, in seconds, private pages are cached.', 'litespeed-cache' ) ; ?>
    				<?php $this->recommended( $id ) ; ?>
    				<?php $this->_validate_ttl( $id, 30 ) ; ?>
    			</div>
    		</td>
    	</tr>
    
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support qtwrk

    (@qtwrk)

    because this will increase the disk usage exponentially

    the public cache is served for all guest users , let’s say you have 1000 pages and all cache takes , just imagine here , 100MB

    on the other hand , the private is per-user-basis , by that saying , for same 1000 pages , if you have 100 active login users , then disk usage will be 100MB * 101 , roughly 10GB , if you have 1000 users , then it’s 100GB and so on

    that’s the reason why it’s limited to such short TTL

    if you don’t worry about the disk space , certainly you can override it to higher TTL.

    Thread Starter nando4

    (@nando4)

    Thank you. I am overriding it to a higher value by modding the PHP code to accept a larger value. Though doesn’t it seem odd that I can’t just enter the Private TTL as required in the field to do so without it arbitrarily limiting me to 60-360 seconds?

    In my case I set:

    • cached logged in users: off
    • Force Cache URIs : list of URLs to cache (these are AFAIK private cache which doesn’t serve individual users but ALL users in a role group)

    So with max private TTL of 360, after 1 hour my private cache that serves many users in a role group expires and needs to be regenerated, which for 120 webpages, requires a resource spike to do and is completely unnecessary. I could do with a 4 week TTL and save CPU and disk resources regenerating those pages every hour.

    • with Private TTL=4 weeks, 1 site regeneration
    • with Private TTL=1 hour, 24 x 7 x 4 = 672 site regenerations

    So here, I present why the private TTL option should be allowed to be a user defined range much like the public TTL as 60-360s, is in my case, is a significant performance hinderance.

    • This reply was modified 1 year, 6 months ago by nando4.
    Thread Starter nando4

    (@nando4)

    Nevermind.. found some problems with my understanding of the caching. Thank you for your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Why is ” Private Cache TTL” maximum 1hr when “Public Cache TTL” isn’t?’ is closed to new replies.