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

Prevent cache from clearing on every admin page load #1536

Closed
abrookbanks opened this Issue Mar 3, 2017 · 20 comments

Comments

Projects
None yet
3 participants
@abrookbanks
Member

abrookbanks commented Mar 3, 2017

Right now every admin page load clears the cache which is not necessary. It must only clear when cache items expire or manually flushed.

@abrookbanks abrookbanks added the bug label Mar 3, 2017

@abrookbanks abrookbanks self-assigned this Mar 3, 2017

@abrookbanks abrookbanks added this to the 6.1.6 milestone Mar 3, 2017

abrookbanks added a commit that referenced this issue Mar 3, 2017

abrookbanks added a commit that referenced this issue Mar 3, 2017

@havenswift-hosting

This comment has been minimized.

havenswift-hosting commented Mar 16, 2017

Any news on this issue ?

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Mar 16, 2017

I don't think a solution is possible until CubeCart v7.

@havenswift-hosting

This comment has been minimized.

havenswift-hosting commented Mar 16, 2017

Is there any particular reason why ? This particularly makes memcache and memcached effectively unusable as multiple sites on a single server using memcache continuously clearing cache creates race conditions in memcache which causes memcache to use huge amounts of memory and CPU when memcache should be very low footprint and highly effective.

This is on top of the general problem with all caching methods where the cache isnt very effective when an admin is in the store as it is continuously being cleared and created, cleared, created. A good caching method should be 95% plus cache hits and CubeCart averages 35%

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Mar 16, 2017

Because there is no way to distinguish what cached elements are for what. We can't clear the cache for product id 5 for example. Ideally if product 5 is edited it clears the cache for just that ID. As CubeCart mainly caches SQL queries with an MD5 identifier we're stuffed.

@havenswift-hosting

This comment has been minimized.

havenswift-hosting commented Mar 17, 2017

There are obviously ways around that although it is more work and not a quick fix. However a quick solution (and the way other systems handle this situation - for example see http://docs.magento.com/m2/ce/user_guide/system/cache-management.html and WordPress cache plugins work in exactly the same way) is to disable all the points where cache is cleared in admin and then have a banner displayed in admin to show that cache has been invalidated and should be refreshed. It is the choice of the admin user when they clear cache and can do it once when they have finished making their changes

abrookbanks added a commit that referenced this issue Mar 22, 2017

@abrookbanks abrookbanks removed the bug label Mar 29, 2017

@havenswift-hosting

This comment has been minimized.

havenswift-hosting commented Apr 3, 2017

Doing more investigation and my suggestion above (banner notice plus admin clearing cache manually) seems to be the way that many other applications work with cache. This would be a VAST improvement on how it currently works

@abrookbanks abrookbanks modified the milestones: 6.1.6, 6.1.7, 6.1.8 Apr 18, 2017

@abrookbanks abrookbanks modified the milestones: 6.2.0, 6.1.8 May 9, 2017

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented May 9, 2017

Sorry the milestone keeps moving on this. It's going to happen and I'm keen to get working on this.

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 5, 2017

I think this is important but people are going to hate it.

@havenswift-hosting

This comment has been minimized.

havenswift-hosting commented Oct 5, 2017

Sorry but I really dont understand why you think people will hate it - what makes you think this ?

It is common practice with most other systems as far as I can see - Magento certainly uses it and WordPress (that currently run approx 30% of all websites !!) also does it this way. Most people dont understand that CubeCart currently clears cache with every single admin action making the cache almost useless (while an admin user is logged in) and those that find out about it are horrified that it works this way. I have used both Magento and many WordPress sites using this mechanism and it is very simple, easy and clear on how it should be used and if it is clearly explained, then people will see the benefits. What is there to hate ?

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 5, 2017

Having to clear cache before the front end updates manually. It will feel like a step backwards. Button position and education is key!

abrookbanks added a commit that referenced this issue Oct 5, 2017

abrookbanks added a commit that referenced this issue Oct 5, 2017

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 5, 2017

I think this works really well already.

@abrookbanks abrookbanks closed this Oct 5, 2017

@havenswift-hosting

This comment has been minimized.

havenswift-hosting commented Oct 8, 2017

Is this still a work in progress ? I dont think the Clear Cache button is obvious enough and it should only be displayed if cache actually needs to be cleared. Removing all those places where cache is automatically cleared is great though !

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 8, 2017

should only be displayed if cache actually needs to be cleared

I'm not sure it can be known for sure aside from the obvious tables. Category, inventory ..

@abrookbanks abrookbanks reopened this Oct 9, 2017

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 9, 2017

No changes made

screen shot 2017-10-09 at 09 36 31

Changes made

screen shot 2017-10-09 at 09 36 46

abrookbanks added a commit that referenced this issue Oct 9, 2017

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 9, 2017

Really happy with this now but keen for more feedback.

@Dirty-Butter

This comment has been minimized.

Dirty-Butter commented Oct 20, 2017

I would like it for sure!

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Oct 20, 2017

yes this is coming very soon

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Feb 12, 2018

This is working very well and I am happy. Needs real world testing.

@abrookbanks abrookbanks changed the title from Admin login should not clear cache but ignore instead to Prevent cache from clearing on ever admin page load Mar 2, 2018

@Dirty-Butter

This comment has been minimized.

Dirty-Butter commented Mar 17, 2018

Well, this may or may not be related. I installed the latest 2.0 on dirtybutter.com/trial over the last commit of v2.0 I had tried, BUT no matter what I did I could not get the storefront to use proper css or possibly js. Whatever it was it looked like a narrow almost phone view. I used maintenance to clear all caches, used the clear cache button in Admin. I rebooted, cleared over and over with no success. I compared all files from the v2.0 download with the online version - all OK.
Today, I deleted ALL my browser temp files (My FireFox is set to automatically clear all browsing data on close so I hadn't suspected that) and manually deleted all temp files in trial. FINALLY I have a proper view of the storefront.
Like I said, it may have been a fluke - but since the way cache works has been changed recently - thought I'd better report it.

@abrookbanks

This comment has been minimized.

Member

abrookbanks commented Mar 18, 2018

It's because of this...
#1905

It will use compressed combined CSS file served from the cache folder if debug mode is off.

@abrookbanks abrookbanks changed the title from Prevent cache from clearing on ever admin page load to Prevent cache from clearing on every admin page load Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment