Image caching at server side - image

For a product catalog web application created in java/spring, which gets the product images from a third party web service, what would be a good strategy for image caching at server side ?
Thanks.

Have your site create IMG references that point to a locally hosted page. This page will do the following:
if (the requested image does not exist in the local cache) {
go to the third party site and save it to the local cache
}
serve the image from the local cache
Depending on how often the images are likely to change on the third party site, you may want to add a cron job that routinely deletes images which are older than X days.

Related

Server caches files

I've installed my laravel project on shared hosting. Everything was fine until when server starts loading old pages and scripts after uploading changes.
I've checked and cleared browser and laravel caches every time but the problem still. Then I've deleted laravel files but the server still loads main page while it should loads main directory content.
Now after installing laravel again the server loads the directory content for main url and works fine for other laravel routs.
The most confusing issue is the when trying to refresh browser several times, it loads the actual pages for one or two times then it back to load old cached files.
That was because of cloudfare caching.So I've to develop locally then upload the final release to remote server
Make sure that you are not using any caching services for page caching(actually page caching is a good feature), if yes please try invalidating the page cache.
If you are using Cloudflare, purge your cache. you can purge the cache of objects or full objects.

How to fetch newly added images from VM in google cloud platform?

When I add images it is stored inside google cloud platform VM correctly.
But I am not able to fetch newly added images in my website.
If I redeploy project with newly added images in assets folder it is showing correctly.
I have verified there is no mistake on frontend or backend side.
Is it not possible to get live image update with VM?
Edit:
I have used Vue.js.
I am storing images inside src/assets folder.
When I save images in my website it is saved at src/assets folder.
I think it can only access things in dist folder after build.
Can you suggest where should I save my file?
I'm making an educateg guess it's some cache issue.
Instead of putting your image files inside the VM you can try storing them in a bucket that's accessible to public. The downside is that it can serve only static files (no PHP or anything).
You have to configure your load balancer to forward all your.domain.com/images/ requests to the bucket but that's actually quite easy. Have a look at my answer asking for such configuration.

Can I edit the contents of my static website after publishing?

I want to publish a website through google domains.
The problem is that I am shifting my office to a new location so, I want to change the map on my website after one month.
Are there any possibilities to edit the website after publishing?
If it is a static website, sure you can update the information you like. Most web hosting services usually use GitHub as a platform for developers to host it. Meaning, you just need to make the necessary changes to your file, upload to Github. Then the hosting services will detect the change and update your site accordingly

Magento: use subdomains as a CDN for media folder

We are planning to use subdomains ie.cdn1.example.com, cdn2.example.com to deliver product images.
How to configure Magento for this?
How to handle Magento cache folder which save auto-generated thumbnails as per template?
If you're using an origin pull CDN like AWS Cloudfront, you just fill in the information telling their system your web server name, they provide you with a server name (randomchars.cloudfront.net) on their end and then you use a CNAME record in your DNS to point their server name at your subdomain name like media.example.com.
Then your base media URL becomes http://media.example.com/media/ and everything's pretty much automatic from there.
Using origin pull gets rid of having to maintain a separate system to host your images and try to get Magento to upload to it, or figure out how to replicate Magento's media folder to it.

Deploying MVC3 Areas (Admin) Separately without modifying the client content implementation

I have web application let us say "client" where contents are controlled by CMS (using MVC3 areas). Both applications are in the same project and the same solution. We just added area for CMS. The CMS or admin area has upload image functionality then the client displays the contents uploaded by admin. We don't have issue if admin and client is hosted on the same IIS directory however our business needs that both admin and client should be deployed on different directory this will become.
CMS: http://cms.com/admin
Client: http://client.com/
All content uploads take place at cms.com and contents will be displayed at client.com
My main issue is that the project was not designed to get images from other web directory. For example currently all images get the path from client.com
<img src="http://client.com/Content/Uploads/img1.jpg"/>
<img src="http://client.com/Content/Uploads/img2.jpg"/>
<img src="http://client.com/Content/Uploads/img3.jpg"/>
Now my question is, is there easiest way a URL helper or anything I can implement without going through modifying all images to reference http://cms.com/Content/Uploads source? Please help.

Resources