Comments (12)
Not at the moment, no. I had no idea anyone would ever want to that, but that makes sense if you're using Varnish. Can you leave this with me to add a new method for this? For the time being maybe just save the cached files to sys_get_temp_dir()
?
from glide.
I probably found the solution. IIRC there is a null adapter in flysystem. That might work.
from glide.
Haha, yep, that would probably work too. ;)
from glide.
Is this repo free for pull requests? I'd like to add something like this:
Current situation:
/**
* Get the source file system.
* @return FilesystemInterface The source file system.
*/
public function getSource()
{
$source = null;
if (isset($this->config['source'])) {
$source = $this->config['source'];
}
if (is_string($source)) {
return new Filesystem(new Local($source));
}
if ($source instanceof FilesystemInterface) {
return $source;
}
throw new InvalidArgumentException('Invalid `source` parameter.');
}
Preferred situation:
/**
* Get the source file system.
* @return FilesystemInterface The source file system.
*/
public function getSource()
{
$source = null;
if (isset($this->config['source'])) {
$source = $this->config['source'];
}
if (is_string($source)) {
return new Filesystem($this->adapter($source, $adapterclass));
}
if ($source instanceof FilesystemInterface) {
return $source;
}
throw new InvalidArgumentException('Invalid `source` parameter.');
}
// Add the source and the adapter, f.e. 'League\Flysystem\Adapter\Null'
public function adapter($source, $class)
{
return new $class($source);
}
from glide.
Hi @xtrasmal, can you explain to me exactly what you're trying to do? I'm sort of confused. If you're simply trying to pass the Null adapter to the Glide factory you can just do this:
$server = League\Glide\ServerFactory::create([
'source' => 'path/to/source/folder',
'cache' => new League\Flysystem\Adapter\Null(),
]);
from glide.
Hi @reinink, passing an instance of Flysystem's NullAdapter (there is no Null) as you suggested does not work:
InvalidArgumentException in ServerFactory.php line 90:
Invalid `cache` parameter.
I believe it has to do with the following check on line 86 of ServerFactory.php just before the InvalidArgumentException gets thrown:
if ($cache instanceof FilesystemInterface) {
return $cache;
}
Because: NullAdapter extends AbstractAdapter which implements AdapterInterface which extends ReadInterface. So it is not an instance of FilesystemInterface.
I believe this is a bug as there is currently no way to turn off caching, which I would like to so as to let a CDN handle caching managed by headers.
Thoughts?
from glide.
Yeah, agreed, I'll add the option to disable the cache in an upcoming release.
from glide.
Is there a way to delete the cached files for a particular image?
Say i have a profile image getting uploaded to the S3 which is scaled at different ui, when the user changes the image it wont change the image endpoints but glide actually serves the old cached images based on old requests.
from glide.
@shyam-achuthan What you're describing is cache invalidation; something that is discussed in another issue.
From my understanding, there is currently no cache invalidation handling in Glide. I submitted a pull request to allow disabling of the cache so that caching - and invalidation - could simply be handled by another layer like a CDN (e.g. Amazon CloudFront) or a reverse proxy (e.g. Nginx).
from glide.
cache invalidation 👍
from glide.
That is my problem
Op 20 mrt. 2015 om 14:17 heeft "Shyam Achuthan" [email protected] het volgende geschreven:
Is there a way to delete the cached files for a particular image?
Say i have a profile image getting uploaded to the S3 which is scaled at different ui, when the user changes the image it wont change the image endpoints but glide actually serves the old cached images based on old requests.—
Reply to this email directly or view it on GitHub.
Met vriendelijke groet, With kind regards,
Xander Smalbil
Netbulae Virtualization Experts
Tel: 053 20 30 270 [email protected] Staalsteden 4-3A KvK 08198180
Fax: 053 20 30 271 www.netbulae.eu 7547 TA Enschede BTW NL821234584B01
from glide.
Hey all, I've finally got a good solution to this cache disabling problem. See #56.
from glide.
Related Issues (20)
- [ feature ] Save resized files to another directory with different link
- Create custom 404 route? HOT 1
- Repeat watermarks
- Mockery error in League\Glide\ServerTest::testMakeImageFromSource HOT 1
- Could not find the image error in Laravel
- how to get with and height of picture after glide traitement HOT 2
- Image will not manipulate when using crop focus zoom and when resize dimensions are equal to original asset dimensions
- ImagickException: NoDecodeDelegateForThisImageFormat `PNG' HOT 1
- Black border added to images during processing HOT 3
- generate a temporarySignedRoute
- Feature request for base_url option to be regular expression
- HEIC format support HOT 2
- We need upgrading to intervention/image ^3 please HOT 2
- Differences in the use of fit=fill and fit=fill-max HOT 3
- Cannot make it working in RAW PHP... pls help 🙇♂️
- upgrade intervention/image to V3 HOT 1
- locale srouce and cache with cdn setting
- not working with laravel 11 HOT 1
- Support intervention/image:^3 HOT 4
- 3.x release date HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glide.