Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glide cache still generated when using external source #178

Open
conradfuhrman opened this issue Oct 28, 2024 · 5 comments
Open

Glide cache still generated when using external source #178

conradfuhrman opened this issue Oct 28, 2024 · 5 comments
Labels
bug Something isn't working

Comments

@conradfuhrman
Copy link

For our SSG project we have three separate buckets on S3.

project-assets
project-glide
project-ssg

Assets is uploaded assets
Glide is a specific bucket just for glide generated items
SSG is our bucket for the final transfer and compile.

When SSG is run, even though these glide assets exist in an external bucket, they are still generated. It would be great to add a flag to enable/disable the generation of these assets along with additional asset_url's for these items.

Since we use them in a separate bucket, the links should just maintain to the glide bucket. Or, as we have had to do in certain instances, we use an S3 sync to copy those glide items to the ssg bucket.

Please let me know what info would help to illustrate this if needed :)

@duncanmcclean
Copy link
Member

When SSG is run, even though these glide assets exist in an external bucket, they are still generated.

Just to clariify, when you say the assets are "still generated". Do you mean they're generated again in the glide bucket or are they being generated again in the ssg bucket when they don't need to be?

@duncanmcclean duncanmcclean added the bug Something isn't working label Oct 28, 2024
@conradfuhrman
Copy link
Author

In our github action docker box. We simply don't need the glide images generated in this case.

@duncanmcclean
Copy link
Member

What does your config/statamic/ssg.php config file look like?

@conradfuhrman
Copy link
Author

conradfuhrman commented Oct 29, 2024

<?php

return [

    /*
    |--------------------------------------------------------------------------
    | Base URL
    |--------------------------------------------------------------------------
    |
    | This informs the generator where the static site will eventually be hosted.
    | For instance, if you are relying on absolute URLs in your app, this one
    | will be used. It should be an absolute URL, eg. "http://my-app.com"
    |
    */
    'index_files' => true,

    'base_url' => env('APP_URL'), 


    /*
    |--------------------------------------------------------------------------
    | Destination Directory
    |--------------------------------------------------------------------------
    |
    | This option defines where the static files will be saved.
    |
    */

    'destination' =>  storage_path('app/static'),

    /*
    |--------------------------------------------------------------------------
    | Files and Symlinks
    |--------------------------------------------------------------------------
    |
    | You are free to define a set of directories to be copied along with the
    | generated HTML files. For example, you may want to link your CSS,
    | JavaScript, static images, and perhaps any uploaded assets.
    | You may choose to symlink rather than copy.
    |
    */

    'copy' => [
        public_path('build') => 'build',
        public_path('css') => 'css',
        public_path('js') => 'js',
        public_path('images') => 'images',
    ],

    'symlinks' => [
        // public_path('build') => 'build',
    ],

    /*
    |--------------------------------------------------------------------------
    | Additional URLs
    |--------------------------------------------------------------------------
    |
    | Here you may define a list of additional URLs to be generated,
    | such as manually created routes.
    |
    */

    'urls' => [
        //
    ],

    /*
    |--------------------------------------------------------------------------
    | Exclude URLs
    |--------------------------------------------------------------------------
    |
    | Here you may define a list of URLs that should not be generated.
    |
    */

    'exclude' => [
        //
    ],

    /*
    |--------------------------------------------------------------------------
    | Pagination Route
    |--------------------------------------------------------------------------
    |
    | Here you may define how paginated entries are routed. This will take
    | effect wherever pagination is detected in your antlers templates,
    | like if you use the `paginate` param on the `collection` tag.
    |
    */

    'pagination_route' => '{url}/{page_name}/{page_number}',

    /*
    |--------------------------------------------------------------------------
    | Glide
    |--------------------------------------------------------------------------
    |
    | Glide images are dynamically resized server-side when requesting a URL.
    | On a static site, you would just be serving HTML files without PHP.
    | Glide images will be pre-generated into the given directory.
    |
    */

    'glide' => [
        'directory' => 'img',
        'override' => true,
    ],

    /*
    |--------------------------------------------------------------------------
    | Failures
    |--------------------------------------------------------------------------
    |
    | You may configure whether the console command will exit early with a
    | failure status code when it encounters errors or warnings. You may
    | want to do this to prevent deployments in CI environments, etc.
    |
    */

    'failures' => false, // 'errors' or 'warnings'

];

@conradfuhrman
Copy link
Author

More of what I think is important is that glide cache from the assets.php we have set to this:

'cache' => 'glide',
'cache_path' => public_path('img'),

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants