While main memory is usually DRAM and cache is SRAM, this isn’t always the case. There have been many systems produced over the years that use SRAM for their main memory. DRAM is usually used for main memory because it’s cheaper, even when you factor in the more expensive DRAM controller (which needs to be more complex due to dynamic refresh). SRAM is more expensive, but it is also faster and generally requires less power.
There is also NVRAM (non-volatile RAM) which retains it’s contents even after power is removed, and of course ROM (read only memory). And, humorously, there is write-only memory (WOM), which is a funny way of referring to memory that you can no longer read due to the hardware failing. Signetics actually published a data sheet for a WOM chip back in the 1970s as a joke.
And with a bit of googling, I managed to find the WOM data sheet:
As far as other types of memory go, there is also FIFO, which is First In First Out. You wouldn’t use this for system memory, but it is still used on things like network interfaces where you can only pull the first message out of the network chip’s queue (many chips set up a ring buffer in RAM these days, but FIFOs are still used). Similar to WOM, you can also have FINO memory, which is first in, never out. The Signetics WOM data sheet mentions that the chip has asynchronous FINO buffers.
You can also have dedicated hardware stacks. Most processors these days have a stack of some sort, but most often it is implemented in system RAM. Some microcontrollers have a dedicated hardware stack, and modern PC processors have a floating point stack since they are backwards compatible to the original 8086 which used a separate chip for floating point operations. The way you do floating point math on a PC is you first load values onto the floating point stack and then do operations on those stack registers. When you are done with your math, you then store the floating point value somewhere (typically back to a variable location in RAM). Google “x86 floating point stack” if you want more gory details.
Similar to FIFO, you can also have LIFO, which is last in, first out. It’s similar to a FIFO, except that access is more like a stack when you push things onto it and pop off the last thing you pushed.
You also have SAM or Sequential Access Memory. You can think of this as kinda like how a disk drive works. You can only read one track’s data sequentially. If you want to read only one part of it, you need to read in the entire track at least up to the point where the data you want is located. Solid state disk drives are internally organized as RAM, but the computer’s access to them treats them as SAM since they emulate a physical disk with heads, tracks, and sectors.
You can also have paged memory. This will often be mapped into a particular memory space, and there will be a page control register that controls which page is currently accessible. Instead of being like system RAM where you can access all of the RAM at once, with paged memory, you select a page to map it into the usable area, then access that page as if it were RAM. Early PCs had this type of memory (called Expanded Memory back in the DOS days) and many microcontrollers still use this type of architecture.