tecnodesignc/core-module

The core module for EncoreCMS 3.0 This is required for every install

Installs: 76

Dependents: 4

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Type:encore-module

3.0.0 2024-04-26 20:21 UTC

This package is auto-updated.

Last update: 2024-10-26 21:39:25 UTC


README

#Core Modules

To activate the Cache System

Modify

// config/app.php

'providers' => [
    ...
    Modules\Core\Pagecache\ResponseCache\ResponseCacheServiceProvider::class,
];

This package also comes with a facade.

// config/app.php

'aliases' => [
    ...
   'ResponseCache' => Modules\Core\Pagecache\ResponseCache::class,
];

You can publish the config file with:

php artisan vendor:publish --provider="Modules\Core\Pagecache\ResponseCache\ResponseCacheServiceProvider"

Command available to clear cache

php artisan pagecache:clear

URL rewriting

In order to serve the static files directly once they've been cached, you need to properly configure your web server to check for those static files.

  • For nginx:

    Update your location block's try_files directive to include a check in the page-cache directory:

    location / {
        try_files $uri $uri/ /page-cache/$uri.html /index.php?$query_string;
    }
  • For apache:

    Open public/.htaccess and add the following before the block labeled Handle Front Controller:

    # Serve Cached Page If Available...
    RewriteCond %{REQUEST_URI} ^/?$
    RewriteCond %{DOCUMENT_ROOT}/page-cache/pc__index__pc.html -f
    RewriteRule .? page-cache/pc__index__pc.html [L]
    RewriteCond %{DOCUMENT_ROOT}/page-cache%{REQUEST_URI}%{QUERY_STRING}.html -f
    RewriteRule . page-cache%{REQUEST_URI}.html [L]