0

I need caching laravel storage image for my React Native app. How can I send my image with cache control header?

Berat
  • 98
  • 1
  • 8
  • You can control some image caching from your server config file. Can you provide more detail of what you want to do and then we can advise further. – Peppermintology Nov 06 '21 at 23:42
  • I need cacheing on my react native application. Image component of React Native wait for cache control header. How can I send cache control header to React Native app? – Berat Nov 07 '21 at 14:39
  • Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. – Community Nov 07 '21 at 22:37

1 Answers1

0

resolved. if you want you can global set cache header in RouteServiceProvider.

here:

public function boot()
    {
        $this->configureRateLimiting();

        $this->routes(function () {
            Route::prefix('api')
                ->middleware('api')
                ->middleware('cache.headers:private;max_age=7200')
                ->namespace($this->namespace)
                ->group(base_path('routes/api.php'));

            Route::middleware('web')
                ->namespace($this->namespace)
                ->middleware('cache.headers:private;max_age=7200')
                ->group(base_path('routes/web.php'));
        });
    }
Berat
  • 98
  • 1
  • 8