Welcome Guest, Not a member yet? Register   Sign In
Caching
#1

(This post was last modified: 11-03-2020, 01:25 AM by boddah85.)

Hello

Im trying to start development in codeigniter 4 and I have a little problem with web caching. I have blog where there's for example articles with comments. I would like to cache all pages but whenever user add a comment page needs to be refreshed. How I can manually delete cached page? 

PHP Code:
public function show(string $title=''int $id=0)
    {
        $this->cachePage(120);
        $this->setArtTitle($title);
        $this->setArtId($id);
        $this->getArtData();
        helper('text');        
        $commentModel 
= new CommentsModel();
 
    
        $this
->dataOutput['art'] = $this->artData;
        $this->dataOutput['title'] = $this->artData->art_title;
        $this->dataOutput['desc'] = character_limiter(strip_tags($this->artData->art_desc),150);
        $this->dataOutput['file'] = 'art';
        $this->dataOutput['comments'] = $commentModel->getArtComments($this->artId)->getResult();
        //view
        return view($this->template,$this->dataOutput);
    

Do I need to clean all cached pages ($cache->clean()) or there's any way to delete choosen cached pages?

Thanks in advance for any help
Reply


Messages In This Thread
Caching - by boddah85 - 11-03-2020, 01:23 AM
RE: Caching - by InsiteFX - 11-03-2020, 04:25 AM
RE: Caching - by boddah85 - 11-03-2020, 04:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB